Summary
The catalog pg_trigger stores triggers on tables and views. See createtrigger for more information.
(Description quoted from the official PostgreSQL documentation.)
Columns
The pg_trigger system catalog exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):
oidoid
Row identifiertgrelidoidreferencespg_class.oid
The table this trigger is ontgparentidoidreferencespg_trigger.oid
Parent trigger that this trigger is cloned from (this happens when partitions are created or attached to a partitioned table); zero if not a clonetgnamename
Trigger name (must be unique among triggers of same table)tgfoidoidreferencespg_proc.oid
The function to be calledtgtypeint2
Bit mask identifying trigger firing conditionstgenabledchar
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.tgisinternalbool
True if trigger is internally generated (usually, to enforce the constraint identified by tgconstraint)tgconstrrelidoidreferencespg_class.oid
The table referenced by a referential integrity constraint (zero if trigger is not for a referential integrity constraint)tgconstrindidoidreferencespg_class.oid
The index supporting a unique, primary key, referential integrity, or exclusion constraint (zero if trigger is not for one of these types of constraint)tgconstraintoidreferencespg_constraint.oid
The pg_constraint entry associated with the trigger (zero if trigger is not for a constraint)tgdeferrablebool
True if constraint trigger is deferrabletginitdeferredbool
True if constraint trigger is initially deferredtgnargsint2
Number of argument strings passed to trigger functiontgattrint2vectorreferencespg_attribute.attnum
Column numbers, if trigger is column-specific; otherwise an empty arraytgargsbytea
Argument strings to pass to trigger, each NULL-terminatedtgqualpg_node_tree
Expression tree (in nodeToString() representation) for the trigger’s WHEN condition, or null if nonetgoldtablename
REFERENCING clause name for OLD TABLE, or null if nonetgnewtablename
REFERENCING clause name for NEW TABLE, or null if none
Related catalogs
This object references the following other system catalogs:
tgrelid→pg_classtgfoid→pg_proctgconstraint→pg_constrainttgattr→pg_attribute
Version applicability
Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.
Related & references
Reference: PostgreSQL documentation — pg_trigger.