22 #include "catalog/pg_trigger_d.h"
34 CATALOG(pg_trigger,2620,TriggerRelationId)
84 DECLARE_INDEX(pg_trigger_tgconstraint_index, 2699, TriggerConstraintIndexId, pg_trigger, btree(tgconstraint oid_ops));
85 DECLARE_UNIQUE_INDEX(pg_trigger_tgrelid_tgname_index, 2701, TriggerRelidNameIndexId, pg_trigger, btree(tgrelid oid_ops, tgname name_ops));
90 #ifdef EXPOSE_TO_CLIENT_CODE
93 #define TRIGGER_TYPE_ROW (1 << 0)
94 #define TRIGGER_TYPE_BEFORE (1 << 1)
95 #define TRIGGER_TYPE_INSERT (1 << 2)
96 #define TRIGGER_TYPE_DELETE (1 << 3)
97 #define TRIGGER_TYPE_UPDATE (1 << 4)
98 #define TRIGGER_TYPE_TRUNCATE (1 << 5)
99 #define TRIGGER_TYPE_INSTEAD (1 << 6)
101 #define TRIGGER_TYPE_LEVEL_MASK (TRIGGER_TYPE_ROW)
102 #define TRIGGER_TYPE_STATEMENT 0
105 #define TRIGGER_TYPE_TIMING_MASK \
106 (TRIGGER_TYPE_BEFORE | TRIGGER_TYPE_INSTEAD)
107 #define TRIGGER_TYPE_AFTER 0
109 #define TRIGGER_TYPE_EVENT_MASK \
110 (TRIGGER_TYPE_INSERT | TRIGGER_TYPE_DELETE | TRIGGER_TYPE_UPDATE | TRIGGER_TYPE_TRUNCATE)
113 #define TRIGGER_CLEAR_TYPE(type) ((type) = 0)
115 #define TRIGGER_SETT_ROW(type) ((type) |= TRIGGER_TYPE_ROW)
116 #define TRIGGER_SETT_STATEMENT(type) ((type) |= TRIGGER_TYPE_STATEMENT)
117 #define TRIGGER_SETT_BEFORE(type) ((type) |= TRIGGER_TYPE_BEFORE)
118 #define TRIGGER_SETT_AFTER(type) ((type) |= TRIGGER_TYPE_AFTER)
119 #define TRIGGER_SETT_INSTEAD(type) ((type) |= TRIGGER_TYPE_INSTEAD)
120 #define TRIGGER_SETT_INSERT(type) ((type) |= TRIGGER_TYPE_INSERT)
121 #define TRIGGER_SETT_DELETE(type) ((type) |= TRIGGER_TYPE_DELETE)
122 #define TRIGGER_SETT_UPDATE(type) ((type) |= TRIGGER_TYPE_UPDATE)
123 #define TRIGGER_SETT_TRUNCATE(type) ((type) |= TRIGGER_TYPE_TRUNCATE)
125 #define TRIGGER_FOR_ROW(type) ((type) & TRIGGER_TYPE_ROW)
126 #define TRIGGER_FOR_BEFORE(type) (((type) & TRIGGER_TYPE_TIMING_MASK) == TRIGGER_TYPE_BEFORE)
127 #define TRIGGER_FOR_AFTER(type) (((type) & TRIGGER_TYPE_TIMING_MASK) == TRIGGER_TYPE_AFTER)
128 #define TRIGGER_FOR_INSTEAD(type) (((type) & TRIGGER_TYPE_TIMING_MASK) == TRIGGER_TYPE_INSTEAD)
129 #define TRIGGER_FOR_INSERT(type) ((type) & TRIGGER_TYPE_INSERT)
130 #define TRIGGER_FOR_DELETE(type) ((type) & TRIGGER_TYPE_DELETE)
131 #define TRIGGER_FOR_UPDATE(type) ((type) & TRIGGER_TYPE_UPDATE)
132 #define TRIGGER_FOR_TRUNCATE(type) ((type) & TRIGGER_TYPE_TRUNCATE)
141 #define TRIGGER_TYPE_MATCHES(type, level, timing, event) \
142 (((type) & (TRIGGER_TYPE_LEVEL_MASK | TRIGGER_TYPE_TIMING_MASK | (event))) == ((level) | (timing) | (event)))
148 #define TRIGGER_USES_TRANSITION_TABLE(namepointer) \
149 ((namepointer) != (char *) NULL)
#define BKI_LOOKUP(catalog)
#define BKI_LOOKUP_OPT(catalog)
#define BKI_FORCE_NOT_NULL
DECLARE_UNIQUE_INDEX_PKEY(pg_trigger_oid_index, 2702, TriggerOidIndexId, pg_trigger, btree(oid oid_ops))
DECLARE_UNIQUE_INDEX(pg_trigger_tgrelid_tgname_index, 2701, TriggerRelidNameIndexId, pg_trigger, btree(tgrelid oid_ops, tgname name_ops))
DECLARE_TOAST(pg_trigger, 2336, 2337)
FormData_pg_trigger * Form_pg_trigger
DECLARE_ARRAY_FOREIGN_KEY((tgrelid, tgattr), pg_attribute,(attrelid, attnum))
DECLARE_INDEX(pg_trigger_tgconstraint_index, 2699, TriggerConstraintIndexId, pg_trigger, btree(tgconstraint oid_ops))
CATALOG(pg_trigger, 2620, TriggerRelationId)