From b339d1fff6c2f14776af29a35c8550b222ca70b2 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 10 Sep 2004 18:40:09 +0000 Subject: 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. --- src/backend/tcop/postgres.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/backend/tcop/postgres.c') diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index a3a96efae9c..50364bd79d3 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.430 2004/08/29 05:06:49 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.431 2004/09/10 18:39:59 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -1823,9 +1823,6 @@ finish_xact_command(void) { if (xact_started) { - /* Invoke IMMEDIATE constraint triggers */ - DeferredTriggerEndQuery(); - /* Cancel any active statement timeout before committing */ disable_sig_alarm(true); -- cgit v1.2.3