PostgreSQL Source Code  git master
reltrigger.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * reltrigger.h
4  * POSTGRES relation trigger definitions.
5  *
6  *
7  * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/utils/reltrigger.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef RELTRIGGER_H
15 #define RELTRIGGER_H
16 
17 
18 /*
19  * These struct really belongs to trigger.h, but we put it separately so that
20  * it can be cleanly included in rel.h and other places.
21  */
22 
23 typedef struct Trigger
24 {
25  Oid tgoid; /* OID of trigger (pg_trigger row) */
26  /* Remaining fields are copied from pg_trigger, see pg_trigger.h */
27  char *tgname;
30  char tgenabled;
32  bool tgisclone;
41  char **tgargs;
42  char *tgqual;
43  char *tgoldtable;
44  char *tgnewtable;
45 } Trigger;
46 
47 typedef struct TriggerDesc
48 {
49  Trigger *triggers; /* array of Trigger structs */
50  int numtriggers; /* number of array entries */
51 
52  /*
53  * These flags indicate whether the array contains at least one of each
54  * type of trigger. We use these to skip searching the array if not.
55  */
71  /* there are no row-level truncate triggers */
74  /* Is there at least one trigger specifying each transition relation? */
79 } TriggerDesc;
80 
81 #endif /* RELTRIGGER_H */
signed short int16
Definition: c.h:354
Oid tgfoid
Definition: reltrigger.h:28
Oid tgoid
Definition: reltrigger.h:25
bool trig_insert_after_statement
Definition: reltrigger.h:60
struct Trigger Trigger
bool tgisinternal
Definition: reltrigger.h:31
bool trig_update_before_statement
Definition: reltrigger.h:64
bool trig_update_new_table
Definition: reltrigger.h:77
unsigned int Oid
Definition: postgres_ext.h:31
bool trig_insert_instead_row
Definition: reltrigger.h:58
bool trig_insert_new_table
Definition: reltrigger.h:75
char * tgqual
Definition: reltrigger.h:42
char tgenabled
Definition: reltrigger.h:30
Oid tgconstraint
Definition: reltrigger.h:35
char * tgname
Definition: reltrigger.h:27
int16 tgtype
Definition: reltrigger.h:29
bool tgdeferrable
Definition: reltrigger.h:36
bool tginitdeferred
Definition: reltrigger.h:37
bool trig_delete_after_row
Definition: reltrigger.h:67
Trigger * triggers
Definition: reltrigger.h:49
bool trig_truncate_before_statement
Definition: reltrigger.h:72
bool trig_update_after_statement
Definition: reltrigger.h:65
bool trig_delete_before_statement
Definition: reltrigger.h:69
bool trig_update_before_row
Definition: reltrigger.h:61
Oid tgconstrrelid
Definition: reltrigger.h:33
bool trig_truncate_after_statement
Definition: reltrigger.h:73
bool trig_insert_after_row
Definition: reltrigger.h:57
bool trig_update_old_table
Definition: reltrigger.h:76
bool trig_update_after_row
Definition: reltrigger.h:62
bool trig_update_instead_row
Definition: reltrigger.h:63
bool tgisclone
Definition: reltrigger.h:32
int numtriggers
Definition: reltrigger.h:50
char ** tgargs
Definition: reltrigger.h:41
bool trig_insert_before_row
Definition: reltrigger.h:56
bool trig_delete_instead_row
Definition: reltrigger.h:68
int16 * tgattr
Definition: reltrigger.h:40
char * tgnewtable
Definition: reltrigger.h:44
bool trig_delete_after_statement
Definition: reltrigger.h:70
Oid tgconstrindid
Definition: reltrigger.h:34
bool trig_insert_before_statement
Definition: reltrigger.h:59
struct TriggerDesc TriggerDesc
int16 tgnattr
Definition: reltrigger.h:39
int16 tgnargs
Definition: reltrigger.h:38
bool trig_delete_old_table
Definition: reltrigger.h:78
char * tgoldtable
Definition: reltrigger.h:43
bool trig_delete_before_row
Definition: reltrigger.h:66