summaryrefslogtreecommitdiff
path: root/src/include/commands
diff options
context:
space:
mode:
authorTom Lane2002-04-01 22:36:13 +0000
committerTom Lane2002-04-01 22:36:13 +0000
commit789ddcb5fe0584fd7524db97909ff43cb2ac37f6 (patch)
treed94e23b6e5606aee2bbe5d5006e6107863daa160 /src/include/commands
parent6a25cd6b26cc5012828119f9c01c93b9d4d46ad7 (diff)
Add tgconstrrelid to stored Trigger structures, make RI trigger functions
depend on this rather than the trigger argument strings to locate the other relation to test. This makes RI triggers function properly in the presence of schemas and temp tables. Along the way, fix bogus lack of locking in RI triggers, handle quoting of names fully correctly, compute required sizes of query buffers with some semblance of accuracy.
Diffstat (limited to 'src/include/commands')
-rw-r--r--src/include/commands/trigger.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h
index c08a4151e3a..4166b47bb74 100644
--- a/src/include/commands/trigger.h
+++ b/src/include/commands/trigger.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: trigger.h,v 1.33 2002/03/29 22:10:34 tgl Exp $
+ * $Id: trigger.h,v 1.34 2002/04/01 22:36:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -81,6 +81,12 @@ typedef struct TriggerData
* constrname\0fkrel\0pkrel\0matchtype\0fkatt\0pkatt\0fkatt\0pkatt\0...
*
* There are one or more pairs of fkatt/pkatt names.
+ *
+ * The relation names are no longer of much use since they are not
+ * guaranteed unique; they are present only for backwards compatibility.
+ * Use the tgrelid and tgconstrrelid fields to identify the referenced
+ * relations, instead. (But note that which is which will depend on which
+ * trigger you are looking at!)
*/
#define RI_CONSTRAINT_NAME_ARGNO 0
#define RI_FK_RELNAME_ARGNO 1
@@ -127,9 +133,8 @@ extern void ExecARUpdateTriggers(EState *estate,
HeapTuple newtuple);
-/* ----------
+/*
* Deferred trigger stuff
- * ----------
*/
typedef struct DeferredTriggerStatusData
{
@@ -139,14 +144,12 @@ typedef struct DeferredTriggerStatusData
typedef struct DeferredTriggerStatusData *DeferredTriggerStatus;
-
typedef struct DeferredTriggerEventItem
{
Oid dti_tgoid;
int32 dti_state;
} DeferredTriggerEventItem;
-
typedef struct DeferredTriggerEventData *DeferredTriggerEvent;
typedef struct DeferredTriggerEventData
@@ -173,7 +176,6 @@ extern void DeferredTriggerSetState(ConstraintsSetStmt *stmt);
/*
* in utils/adt/ri_triggers.c
- *
*/
extern bool RI_FKey_keyequal_upd(TriggerData *trigdata);