pg_trigger
The catalog pg_trigger stores triggers on tables and views. See CREATE TRIGGER for more information.
Table 47-45. pg_trigger Columns
Name | Type | References | Description |
---|---|---|---|
oid | oid | Row identifier (hidden attribute; must be explicitly selected) | |
tgrelid | oid | pg_class.oid | The table this trigger is on |
tgname | name | Trigger name (must be unique among triggers of same table) | |
tgfoid | oid | pg_proc.oid | The function to be called |
tgtype | int2 | Bit mask identifying trigger firing conditions | |
tgenabled | char | Controls in which session_replication_role modes the trigger fires. O = trigger fires in "origin" and "local" modes, D = trigger is disabled, R = trigger fires in "replica" mode, A = trigger fires always. | |
tgisinternal | bool | True if trigger is internally generated (usually, to enforce the constraint identified by tgconstraint) | |
tgconstrrelid | oid | pg_class.oid | The table referenced by a referential integrity constraint |
tgconstrindid | oid | pg_class.oid | The index supporting a unique, primary key, or referential integrity constraint |
tgconstraint | oid | pg_constraint.oid | The pg_constraint entry associated with the trigger, if any |
tgdeferrable | bool | True if constraint trigger is deferrable | |
tginitdeferred | bool | True if constraint trigger is initially deferred | |
tgnargs | int2 | Number of argument strings passed to trigger function | |
tgattr | int2vector | pg_attribute.attnum | Column numbers, if trigger is column-specific; otherwise an empty array |
tgargs | bytea | Argument strings to pass to trigger, each NULL-terminated | |
tgqual | pg_node_tree | Expression tree (in nodeToString() representation) for the trigger's WHEN condition, or null if none |