1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-18 17:42:25 +03:00

Make ALTER TABLE RENAME update foreign-key trigger arguments correctly.

Brent Verner, with review and kibitzing from Tom Lane.
This commit is contained in:
Tom Lane
2001-11-12 00:46:36 +00:00
parent 8bfc437301
commit f14fdad858
3 changed files with 304 additions and 13 deletions

View File

@ -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.30 2001/11/05 17:46:33 momjian Exp $
* $Id: trigger.h,v 1.31 2001/11/12 00:46:36 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -78,6 +78,25 @@ typedef struct TriggerData
#define TRIGGER_FIRED_AFTER(event) \
(!TRIGGER_FIRED_BEFORE (event))
/*
* RI trigger function arguments are stored in pg_trigger.tgargs bytea
*
* constrname\0fkrel\0pkrel\0matchtype\0fkatt\0pkatt\0fkatt\0pkatt\0...
*
* There are one or more pairs of fkatt/pkatt names.
*/
#define RI_CONSTRAINT_NAME_ARGNO 0
#define RI_FK_RELNAME_ARGNO 1
#define RI_PK_RELNAME_ARGNO 2
#define RI_MATCH_TYPE_ARGNO 3
#define RI_FIRST_ATTNAME_ARGNO 4 /* first attname pair starts here */
#define RI_KEYPAIR_FK_IDX 0
#define RI_KEYPAIR_PK_IDX 1
#define RI_MAX_NUMKEYS INDEX_MAX_KEYS
#define RI_MAX_ARGUMENTS (RI_FIRST_ATTNAME_ARGNO + (RI_MAX_NUMKEYS * 2))
extern void CreateTrigger(CreateTrigStmt *stmt);
extern void DropTrigger(DropTrigStmt *stmt);