Fix AfterTriggerSaveEvent to use a test and elog, not just Assert, to check

Tom Lane <tgl@sss.pgh.pa.us>

Commit: b9d803bc82954dd7278f28b7470a6d3943f80ef9
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2009-10-27T20:15:04Z
Releases: 8.0.23
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.

Files

PathChange+/−
src/backend/commands/trigger.c modified +8 −1