aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xact.c
diff options
context:
space:
mode:
authorJan Wieck <JanWieck@Yahoo.com>1999-09-29 16:06:40 +0000
committerJan Wieck <JanWieck@Yahoo.com>1999-09-29 16:06:40 +0000
commit1547ee017c897725221d0752af4477121524c05b (patch)
tree775616278865cba3e01e521812d045489e40fd9b /src/backend/access/transam/xact.c
parentd810338d29bff178101e72c810c9dcfa3223c6c0 (diff)
downloadpostgresql-1547ee017c897725221d0752af4477121524c05b.tar.gz
postgresql-1547ee017c897725221d0752af4477121524c05b.zip
This is part #1 for of the DEFERRED CONSTRAINT TRIGGER support.
Implements the CREATE CONSTRAINT TRIGGER and SET CONSTRAINTS commands. TODO: Generic builtin trigger procedures Automatic execution of appropriate CREATE CONSTRAINT... at CREATE TABLE Support of new trigger type in pg_dump Swapping of huge # of events to disk Jan
Diffstat (limited to 'src/backend/access/transam/xact.c')
-rw-r--r--src/backend/access/transam/xact.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index dc5bbcd32eb..f468e2916b1 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.54 1999/09/28 11:41:03 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.55 1999/09/29 16:05:55 wieck Exp $
*
* NOTES
* Transaction aborts can now occur two ways:
@@ -149,6 +149,7 @@
#include "commands/async.h"
#include "commands/sequence.h"
#include "commands/vacuum.h"
+#include "commands/trigger.h"
#include "libpq/be-fsstubs.h"
#include "storage/proc.h"
#include "storage/sinval.h"
@@ -866,6 +867,12 @@ StartTransaction()
InitNoNameRelList();
/* ----------------
+ * Tell the trigger manager to we're starting a transaction
+ * ----------------
+ */
+ DeferredTriggerBeginXact();
+
+ /* ----------------
* done with start processing, set current transaction
* state to "in progress"
* ----------------
@@ -905,6 +912,14 @@ CommitTransaction()
elog(NOTICE, "CommitTransaction and not in in-progress state ");
/* ----------------
+ * Tell the trigger manager that this transaction is about to be
+ * committed. He'll invoke all trigger deferred until XACT before
+ * we really start on committing the transaction.
+ * ----------------
+ */
+ DeferredTriggerEndXact();
+
+ /* ----------------
* set the current transaction state information
* appropriately during the abort processing
* ----------------
@@ -993,6 +1008,13 @@ AbortTransaction()
elog(NOTICE, "AbortTransaction and not in in-progress state ");
/* ----------------
+ * Tell the trigger manager that this transaction is about to be
+ * aborted.
+ * ----------------
+ */
+ DeferredTriggerAbortXact();
+
+ /* ----------------
* set the current transaction state information
* appropriately during the abort processing
* ----------------