title: Postgres trigger procedure on insert using data in inserted fields to insert calculated data in another field
body: <p>Say I have a table <code>X</code>, and <code>X</code> has fields <code>X1</code>, <code>X2</code> and <code>X3</code>. </p>
  
  <p>I want a solution that whenever I insert values for <code>X1</code> and <code>X2</code>, <code>X3</code> is set automatically to the sum of X1 and X2 with a trigger. </p>
  
  <p>This is something very simple to do in mysql, but after a while on google I cant find a good example of this for postgres, just some info about For each row triggers, but again no examples.</p>