4 The catalog pg_trigger stores triggers on tables and views. See CREATE
5 TRIGGER for more information.
7 Table 52.58. pg_trigger Columns
17 tgrelid oid (references pg_class.oid)
19 The table this trigger is on
21 tgparentid oid (references pg_trigger.oid)
23 Parent trigger that this trigger is cloned from (this happens when
24 partitions are created or attached to a partitioned table); zero if not
29 Trigger name (must be unique among triggers of same table)
31 tgfoid oid (references pg_proc.oid)
33 The function to be called
37 Bit mask identifying trigger firing conditions
41 Controls in which session_replication_role modes the trigger fires. O =
42 trigger fires in “origin” and “local” modes, D = trigger is disabled, R
43 = trigger fires in “replica” mode, A = trigger fires always.
47 True if trigger is internally generated (usually, to enforce the
48 constraint identified by tgconstraint)
50 tgconstrrelid oid (references pg_class.oid)
52 The table referenced by a referential integrity constraint (zero if
53 trigger is not for a referential integrity constraint)
55 tgconstrindid oid (references pg_class.oid)
57 The index supporting a unique, primary key, referential integrity, or
58 exclusion constraint (zero if trigger is not for one of these types of
61 tgconstraint oid (references pg_constraint.oid)
63 The pg_constraint entry associated with the trigger (zero if trigger is
68 True if constraint trigger is deferrable
72 True if constraint trigger is initially deferred
76 Number of argument strings passed to trigger function
78 tgattr int2vector (references pg_attribute.attnum)
80 Column numbers, if trigger is column-specific; otherwise an empty array
84 Argument strings to pass to trigger, each NULL-terminated
88 Expression tree (in nodeToString() representation) for the trigger's
89 WHEN condition, or null if none
93 REFERENCING clause name for OLD TABLE, or null if none
97 REFERENCING clause name for NEW TABLE, or null if none
99 Currently, column-specific triggering is supported only for UPDATE
100 events, and so tgattr is relevant only for that event type. tgtype
101 might contain bits for other event types as well, but those are
102 presumed to be table-wide regardless of what is in tgattr.
106 When tgconstraint is nonzero, tgconstrrelid, tgconstrindid,
107 tgdeferrable, and tginitdeferred are largely redundant with the
108 referenced pg_constraint entry. However, it is possible for a
109 non-deferrable trigger to be associated with a deferrable constraint:
110 foreign key constraints can have some deferrable and some
111 non-deferrable triggers.
115 pg_class.relhastriggers must be true if a relation has any triggers in