PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pg_trigger.h File Reference
#include "catalog/genbki.h"
Include dependency graph for pg_trigger.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TriggerRelationId   2620
 
#define Natts_pg_trigger   17
 
#define Anum_pg_trigger_tgrelid   1
 
#define Anum_pg_trigger_tgname   2
 
#define Anum_pg_trigger_tgfoid   3
 
#define Anum_pg_trigger_tgtype   4
 
#define Anum_pg_trigger_tgenabled   5
 
#define Anum_pg_trigger_tgisinternal   6
 
#define Anum_pg_trigger_tgconstrrelid   7
 
#define Anum_pg_trigger_tgconstrindid   8
 
#define Anum_pg_trigger_tgconstraint   9
 
#define Anum_pg_trigger_tgdeferrable   10
 
#define Anum_pg_trigger_tginitdeferred   11
 
#define Anum_pg_trigger_tgnargs   12
 
#define Anum_pg_trigger_tgattr   13
 
#define Anum_pg_trigger_tgargs   14
 
#define Anum_pg_trigger_tgqual   15
 
#define Anum_pg_trigger_tgoldtable   16
 
#define Anum_pg_trigger_tgnewtable   17
 
#define TRIGGER_TYPE_ROW   (1 << 0)
 
#define TRIGGER_TYPE_BEFORE   (1 << 1)
 
#define TRIGGER_TYPE_INSERT   (1 << 2)
 
#define TRIGGER_TYPE_DELETE   (1 << 3)
 
#define TRIGGER_TYPE_UPDATE   (1 << 4)
 
#define TRIGGER_TYPE_TRUNCATE   (1 << 5)
 
#define TRIGGER_TYPE_INSTEAD   (1 << 6)
 
#define TRIGGER_TYPE_LEVEL_MASK   (TRIGGER_TYPE_ROW)
 
#define TRIGGER_TYPE_STATEMENT   0
 
#define TRIGGER_TYPE_TIMING_MASK   (TRIGGER_TYPE_BEFORE | TRIGGER_TYPE_INSTEAD)
 
#define TRIGGER_TYPE_AFTER   0
 
#define TRIGGER_TYPE_EVENT_MASK   (TRIGGER_TYPE_INSERT | TRIGGER_TYPE_DELETE | TRIGGER_TYPE_UPDATE | TRIGGER_TYPE_TRUNCATE)
 
#define TRIGGER_CLEAR_TYPE(type)   ((type) = 0)
 
#define TRIGGER_SETT_ROW(type)   ((type) |= TRIGGER_TYPE_ROW)
 
#define TRIGGER_SETT_STATEMENT(type)   ((type) |= TRIGGER_TYPE_STATEMENT)
 
#define TRIGGER_SETT_BEFORE(type)   ((type) |= TRIGGER_TYPE_BEFORE)
 
#define TRIGGER_SETT_AFTER(type)   ((type) |= TRIGGER_TYPE_AFTER)
 
#define TRIGGER_SETT_INSTEAD(type)   ((type) |= TRIGGER_TYPE_INSTEAD)
 
#define TRIGGER_SETT_INSERT(type)   ((type) |= TRIGGER_TYPE_INSERT)
 
#define TRIGGER_SETT_DELETE(type)   ((type) |= TRIGGER_TYPE_DELETE)
 
#define TRIGGER_SETT_UPDATE(type)   ((type) |= TRIGGER_TYPE_UPDATE)
 
#define TRIGGER_SETT_TRUNCATE(type)   ((type) |= TRIGGER_TYPE_TRUNCATE)
 
#define TRIGGER_FOR_ROW(type)   ((type) & TRIGGER_TYPE_ROW)
 
#define TRIGGER_FOR_BEFORE(type)   (((type) & TRIGGER_TYPE_TIMING_MASK) == TRIGGER_TYPE_BEFORE)
 
#define TRIGGER_FOR_AFTER(type)   (((type) & TRIGGER_TYPE_TIMING_MASK) == TRIGGER_TYPE_AFTER)
 
#define TRIGGER_FOR_INSTEAD(type)   (((type) & TRIGGER_TYPE_TIMING_MASK) == TRIGGER_TYPE_INSTEAD)
 
#define TRIGGER_FOR_INSERT(type)   ((type) & TRIGGER_TYPE_INSERT)
 
#define TRIGGER_FOR_DELETE(type)   ((type) & TRIGGER_TYPE_DELETE)
 
#define TRIGGER_FOR_UPDATE(type)   ((type) & TRIGGER_TYPE_UPDATE)
 
#define TRIGGER_FOR_TRUNCATE(type)   ((type) & TRIGGER_TYPE_TRUNCATE)
 
#define TRIGGER_TYPE_MATCHES(type, level, timing, event)   (((type) & (TRIGGER_TYPE_LEVEL_MASK | TRIGGER_TYPE_TIMING_MASK | (event))) == ((level) | (timing) | (event)))
 
#define TRIGGER_USES_TRANSITION_TABLE(namepointer)   ((namepointer) != (char *) NULL)
 

Typedefs

typedef FormData_pg_triggerForm_pg_trigger
 

Functions

 CATALOG (pg_trigger, 2620)
 

Variables

 FormData_pg_trigger
 

Macro Definition Documentation

#define Anum_pg_trigger_tgargs   14

Definition at line 92 of file pg_trigger.h.

Referenced by CreateTrigger(), pg_get_triggerdef_worker(), and RelationBuildTriggers().

#define Anum_pg_trigger_tgattr   13

Definition at line 91 of file pg_trigger.h.

Referenced by CreateTrigger().

#define Anum_pg_trigger_tgconstraint   9

Definition at line 87 of file pg_trigger.h.

Referenced by AfterTriggerSetState(), ATExecAlterConstraint(), and CreateTrigger().

#define Anum_pg_trigger_tgconstrindid   8

Definition at line 86 of file pg_trigger.h.

Referenced by CreateTrigger().

#define Anum_pg_trigger_tgconstrrelid   7

Definition at line 85 of file pg_trigger.h.

Referenced by CreateTrigger().

#define Anum_pg_trigger_tgdeferrable   10

Definition at line 88 of file pg_trigger.h.

Referenced by CreateTrigger().

#define Anum_pg_trigger_tgenabled   5

Definition at line 83 of file pg_trigger.h.

Referenced by CreateTrigger().

#define Anum_pg_trigger_tgfoid   3

Definition at line 81 of file pg_trigger.h.

Referenced by CreateTrigger().

#define Anum_pg_trigger_tginitdeferred   11

Definition at line 89 of file pg_trigger.h.

Referenced by CreateTrigger().

#define Anum_pg_trigger_tgisinternal   6

Definition at line 84 of file pg_trigger.h.

Referenced by CreateTrigger().

#define Anum_pg_trigger_tgname   2

Definition at line 80 of file pg_trigger.h.

Referenced by CreateTrigger(), EnableDisableTrigger(), get_trigger_oid(), and renametrig().

#define Anum_pg_trigger_tgnargs   12

Definition at line 90 of file pg_trigger.h.

Referenced by CreateTrigger().

#define Anum_pg_trigger_tgnewtable   17

Definition at line 95 of file pg_trigger.h.

Referenced by CreateTrigger(), pg_get_triggerdef_worker(), and RelationBuildTriggers().

#define Anum_pg_trigger_tgoldtable   16

Definition at line 94 of file pg_trigger.h.

Referenced by CreateTrigger(), pg_get_triggerdef_worker(), and RelationBuildTriggers().

#define Anum_pg_trigger_tgqual   15

Definition at line 93 of file pg_trigger.h.

Referenced by CreateTrigger(), pg_get_triggerdef_worker(), and RelationBuildTriggers().

#define Anum_pg_trigger_tgrelid   1
#define Anum_pg_trigger_tgtype   4

Definition at line 82 of file pg_trigger.h.

Referenced by CreateTrigger().

#define Natts_pg_trigger   17

Definition at line 78 of file pg_trigger.h.

Referenced by CreateTrigger(), and insert_event_trigger_tuple().

#define TRIGGER_CLEAR_TYPE (   type)    ((type) = 0)

Definition at line 118 of file pg_trigger.h.

Referenced by CreateTrigger().

#define TRIGGER_FOR_AFTER (   type)    (((type) & TRIGGER_TYPE_TIMING_MASK) == TRIGGER_TYPE_AFTER)

Definition at line 132 of file pg_trigger.h.

Referenced by dumpTrigger(), and pg_get_triggerdef_worker().

#define TRIGGER_FOR_BEFORE (   type)    (((type) & TRIGGER_TYPE_TIMING_MASK) == TRIGGER_TYPE_BEFORE)

Definition at line 131 of file pg_trigger.h.

Referenced by CreateTrigger(), dumpTrigger(), and pg_get_triggerdef_worker().

#define TRIGGER_FOR_DELETE (   type)    ((type) & TRIGGER_TYPE_DELETE)
#define TRIGGER_FOR_INSERT (   type)    ((type) & TRIGGER_TYPE_INSERT)
#define TRIGGER_FOR_INSTEAD (   type)    (((type) & TRIGGER_TYPE_TIMING_MASK) == TRIGGER_TYPE_INSTEAD)

Definition at line 133 of file pg_trigger.h.

Referenced by CreateTrigger(), dumpTrigger(), and pg_get_triggerdef_worker().

#define TRIGGER_FOR_ROW (   type)    ((type) & TRIGGER_TYPE_ROW)

Definition at line 130 of file pg_trigger.h.

Referenced by CreateTrigger(), dumpTrigger(), and pg_get_triggerdef_worker().

#define TRIGGER_FOR_TRUNCATE (   type)    ((type) & TRIGGER_TYPE_TRUNCATE)

Definition at line 137 of file pg_trigger.h.

Referenced by CreateTrigger(), dumpTrigger(), and pg_get_triggerdef_worker().

#define TRIGGER_FOR_UPDATE (   type)    ((type) & TRIGGER_TYPE_UPDATE)
#define TRIGGER_SETT_AFTER (   type)    ((type) |= TRIGGER_TYPE_AFTER)

Definition at line 123 of file pg_trigger.h.

#define TRIGGER_SETT_BEFORE (   type)    ((type) |= TRIGGER_TYPE_BEFORE)

Definition at line 122 of file pg_trigger.h.

#define TRIGGER_SETT_DELETE (   type)    ((type) |= TRIGGER_TYPE_DELETE)

Definition at line 126 of file pg_trigger.h.

#define TRIGGER_SETT_INSERT (   type)    ((type) |= TRIGGER_TYPE_INSERT)

Definition at line 125 of file pg_trigger.h.

#define TRIGGER_SETT_INSTEAD (   type)    ((type) |= TRIGGER_TYPE_INSTEAD)

Definition at line 124 of file pg_trigger.h.

#define TRIGGER_SETT_ROW (   type)    ((type) |= TRIGGER_TYPE_ROW)

Definition at line 120 of file pg_trigger.h.

Referenced by CreateTrigger().

#define TRIGGER_SETT_STATEMENT (   type)    ((type) |= TRIGGER_TYPE_STATEMENT)

Definition at line 121 of file pg_trigger.h.

#define TRIGGER_SETT_TRUNCATE (   type)    ((type) |= TRIGGER_TYPE_TRUNCATE)

Definition at line 128 of file pg_trigger.h.

#define TRIGGER_SETT_UPDATE (   type)    ((type) |= TRIGGER_TYPE_UPDATE)

Definition at line 127 of file pg_trigger.h.

#define TRIGGER_TYPE_DELETE   (1 << 3)

Definition at line 114 of file pg_trigger.h.

#define TRIGGER_TYPE_INSTEAD   (1 << 6)
#define TRIGGER_TYPE_LEVEL_MASK   (TRIGGER_TYPE_ROW)

Definition at line 106 of file pg_trigger.h.

#define TRIGGER_TYPE_MATCHES (   type,
  level,
  timing,
  event 
)    (((type) & (TRIGGER_TYPE_LEVEL_MASK | TRIGGER_TYPE_TIMING_MASK | (event))) == ((level) | (timing) | (event)))
#define TRIGGER_TYPE_STATEMENT   0
#define TRIGGER_TYPE_TIMING_MASK   (TRIGGER_TYPE_BEFORE | TRIGGER_TYPE_INSTEAD)

Definition at line 110 of file pg_trigger.h.

#define TRIGGER_TYPE_TRUNCATE   (1 << 5)

Definition at line 103 of file pg_trigger.h.

Referenced by AfterTriggerSaveEvent(), ExecBSTruncateTriggers(), and SetTriggerFlags().

#define TRIGGER_USES_TRANSITION_TABLE (   namepointer)    ((namepointer) != (char *) NULL)

Definition at line 153 of file pg_trigger.h.

Referenced by SetTriggerFlags().

Typedef Documentation

Function Documentation

CATALOG ( pg_trigger  ,
2620   
)

Definition at line 36 of file pg_trigger.h.

References BKI_FORCE_NOT_NULL.

37 {
38  Oid tgrelid; /* relation trigger is attached to */
39  NameData tgname; /* trigger's name */
40  Oid tgfoid; /* OID of function to be called */
41  int16 tgtype; /* BEFORE/AFTER/INSTEAD, UPDATE/DELETE/INSERT,
42  * ROW/STATEMENT; see below */
43  char tgenabled; /* trigger's firing configuration WRT
44  * session_replication_role */
45  bool tgisinternal; /* trigger is system-generated */
46  Oid tgconstrrelid; /* constraint's FROM table, if any */
47  Oid tgconstrindid; /* constraint's supporting index, if any */
48  Oid tgconstraint; /* associated pg_constraint entry, if any */
49  bool tgdeferrable; /* constraint trigger is deferrable */
50  bool tginitdeferred; /* constraint trigger is deferred initially */
51  int16 tgnargs; /* # of extra arguments in tgargs */
52 
53  /*
54  * Variable-length fields start here, but we allow direct access to
55  * tgattr. Note: tgattr and tgargs must not be null.
56  */
57  int2vector tgattr; /* column numbers, if trigger is on columns */
58 
59 #ifdef CATALOG_VARLEN
60  bytea tgargs BKI_FORCE_NOT_NULL; /* first\000second\000tgnargs\000 */
61  pg_node_tree tgqual; /* WHEN expression, or NULL if none */
62  NameData tgoldtable; /* old transition table, or NULL if none */
63  NameData tgnewtable; /* new transition table, or NULL if none */
64 #endif
signed short int16
Definition: c.h:252
FormData_pg_trigger
Definition: pg_trigger.h:65
unsigned int Oid
Definition: postgres_ext.h:31
#define BKI_FORCE_NOT_NULL
Definition: genbki.h:32
Definition: c.h:489
Definition: c.h:463
Definition: c.h:435

Variable Documentation

FormData_pg_trigger

Definition at line 65 of file pg_trigger.h.