title: FOR EACH STATEMENT trigger example
body: <p>I've been looking at the <a href="http://www.postgresql.org/docs/9.2/static/plpgsql-trigger.html">documentation of postgresql triggers</a>, but it seems to only show examples for row-level triggers, but I can't find an example for a statement-level trigger. </p>
  
  <p>In particular, it is not quite clear how to iterate in the update/inserted rows in a single statement, since <code>NEW</code> is for a single record.</p>