]> granicus.if.org Git - postgresql/commit
Fix sloppy usage of TRIGGER_FIRED_BEFORE/TRIGGER_FIRED_AFTER.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 8 Oct 2010 17:27:31 +0000 (13:27 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 8 Oct 2010 17:27:31 +0000 (13:27 -0400)
commitcaaf2e84698940c093e6cf6203014883e4fb18c5
treea58e012ed0cf261b0ebb0201943cb063ee42d933
parent56ccff59806793198020a6a3d154bbce6dfb7a06
Fix sloppy usage of TRIGGER_FIRED_BEFORE/TRIGGER_FIRED_AFTER.

Various places were testing TRIGGER_FIRED_BEFORE() where what they really
meant was !TRIGGER_FIRED_AFTER(), or vice versa.  This needs to be cleaned
up because there are about to be more than two possible states.

We might want to note this in the 9.1 release notes as something for
trigger authors to double-check.

For consistency's sake I also changed some places that assumed that
TRIGGER_FIRED_FOR_ROW and TRIGGER_FIRED_FOR_STATEMENT are necessarily
mutually exclusive; that's not in immediate danger of breaking, but
it's still sloppier than it should be.

Extracted from Dean Rasheed's patch for triggers on views.  I'm committing
this separately since it's an identifiable separate issue, and is the
only reason for the patch to touch most of these particular files.
contrib/spi/autoinc.c
contrib/spi/insert_username.c
contrib/spi/moddatetime.c
contrib/spi/refint.c
contrib/spi/timetravel.c
src/backend/utils/adt/tsvector_op.c
src/pl/plpgsql/src/pl_exec.c
src/pl/plpython/plpython.c
src/test/regress/regress.c