title: Trigger to update current date in  Postgres 9
body: <p>I have two tables called <code>sale</code> and <code>customer</code>. I want to create a trigger that updates the column <code>last_purchase</code> on <code>customer</code> table on each new insert in the <code>sale</code> table. </p>
  
  <p>Table customer: customer_id, name, last_sale, ...<br>
  Table sale: sale_id, customer_id, date, ...</p>
  
  <pre><code>CREATE TRIGGER update_last_sale BEFORE INSERT ON sale FOR EACH ROW EXECUTE...
  </code></pre>
  
  <p>I have started writing but I don't know how to do it.<br>
  Could someone help me?</p>