Here is a WIP patch implementing triggers on VIEWs, as outlined in the
proof-of-concept here:
http://archives.postgresql.org/pgsql-hackers/2010-08/msg00160.php
The new triggers allowed on a VIEW are:
1). Statement-level BEFORE INSERT/UPDATE/DELETE
2). Row-level INSTEAD OF INSERT/UPDATE/DELETE
3). Statement-level AFTER INSERT/UPDATE/DELETE
The new INSTEAD OF trigger type may only be used with VIEWs, and may
only be row-level. It does not support the WHEN or FOR UPDATE OF
column_list options.
There are still a number of things left todo:
- extend ALTER VIEW with enable/disable trigger commands
- much more testing
- documentation
and then there's the question of what to do about the concurrency
issues raised by Marko Tiikkaja. Currently it works like Oracle (i.e.,
no locking).
Regards,
Dean