Karl Nack <karlnack@xxxxxxxxxxxxxxx> writes: > I notice the row count does not reflect the newly-inserted row, which > suggests that the trigger is not seeing changes made to the table. This > seems to be exactly opposite of what's in the manual: > http://www.postgresql.org/docs/8.3/interactive/trigger-datachanges.html > http://www.postgresql.org/docs/8.3/interactive/trigger-example.html The reason is that you've declared the function STABLE, which causes it to use the calling query's starting snapshot. So it cannot see any in-progress changes of the calling query. Declare it VOLATILE (or let it default to that) and it will act as you expect. I'm not sure if the cited portions of the manual ought to contain notes about this or not. It seems a bit off-topic for them, but if other people have been bit by this, then maybe ... comments anyone? regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general