Fix AfterTriggerSaveEvent to use a test and elog, not just Assert, to check
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 27 Oct 2009 20:14:27 +0000 (20:14 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 27 Oct 2009 20:14:27 +0000 (20:14 +0000)
commit44956c52c5fef0b2bb541e959bd65910949eb15f
tree27cfea32bd19523ce1b74ff92505af302c8b917b
parent61e532820824504aa92ad93c427722d3fa9c1632
Fix AfterTriggerSaveEvent to use a test and elog, not just Assert, to check
that it's called within an AfterTriggerBeginQuery/AfterTriggerEndQuery pair.
The RI cascade triggers suppress that overhead on the assumption that they
are always run non-deferred, so it's possible to violate the condition if
someone mistakenly changes pg_trigger to mark such a trigger deferred.
We don't really care about supporting that, but throwing an error instead
of crashing seems desirable.  Per report from Marcelo Costa.
src/backend/commands/trigger.c