FOR EACH STATEMENT trigger example
问题 I've been looking at the documentation of postgresql triggers, but it seems to only show examples for row-level triggers, but I can't find an example for a statement-level trigger. In particular, it is not quite clear how to iterate in the update/inserted rows in a single statement, since NEW is for a single record. 回答1: OLD and NEW are null or not defined in a statement-level trigger. Per documentation: NEW Data type RECORD ; variable holding the new database row for INSERT / UPDATE