]> granicus.if.org Git - postgresql/commit
Fire non-deferred AFTER triggers immediately upon query completion,
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 Sep 2004 18:40:09 +0000 (18:40 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 Sep 2004 18:40:09 +0000 (18:40 +0000)
commitb339d1fff6c2f14776af29a35c8550b222ca70b2
treebe0ed19fa78e35cdde627d1c6bc4c4be9f7cb44e
parent856d1faac1024717b7c37665c46fd635dc52b1b4
Fire non-deferred AFTER triggers immediately upon query completion,
rather than when returning to the idle loop.  This makes no particular
difference for interactively-issued queries, but it makes a big difference
for queries issued within functions: trigger execution now occurs before
the calling function is allowed to proceed.  This responds to numerous
complaints about nonintuitive behavior of foreign key checking, such as
http://archives.postgresql.org/pgsql-bugs/2004-09/msg00020.php, and
appears to be required by the SQL99 spec.
Also take the opportunity to simplify the data structures used for the
pending-trigger list, rename them for more clarity, and squeeze out a
bit of space.
17 files changed:
doc/src/sgml/ref/set_constraints.sgml
doc/src/sgml/release.sgml
src/backend/access/transam/xact.c
src/backend/commands/copy.c
src/backend/commands/explain.c
src/backend/commands/portalcmds.c
src/backend/commands/trigger.c
src/backend/executor/functions.c
src/backend/executor/spi.c
src/backend/tcop/postgres.c
src/backend/tcop/pquery.c
src/backend/tcop/utility.c
src/backend/utils/adt/ri_triggers.c
src/include/commands/trigger.h
src/test/regress/expected/foreign_key.out
src/test/regress/expected/plpgsql.out
src/test/regress/sql/plpgsql.sql