select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

SYSTEM CATALOGS / SYSTEM CATALOGS

The catalog pg_trigger stores triggers on tables and views.

Kind
System catalogs
Columns in this snapshot
19
Definition source
English manual

Columns 19

ColumnTypeDescription / reference
oidoidRow identifier
tgrelidoidThe table this trigger is on
pg_class.oid
tgparentidoidParent trigger that this trigger is cloned from (this happens when partitions are created or attached to a partitioned table); zero if not a clone
tgnamenameTrigger name (must be unique among triggers of same table)
tgfoidoidThe function to be called
pg_proc.oid
tgtypeint2Bit mask identifying trigger firing conditions
tgenabledcharControls 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.
tgisinternalboolTrue if trigger is internally generated (usually, to enforce the constraint identified by tgconstraint)
tgconstrrelidoidThe table referenced by a referential integrity constraint (zero if trigger is not for a referential integrity constraint)
pg_class.oid
tgconstrindidoidThe index supporting a unique, primary key, referential integrity, or exclusion constraint (zero if trigger is not for one of these types of constraint)
pg_class.oid
tgconstraintoidThe pg_constraint entry associated with the trigger (zero if trigger is not for a constraint)
pg_constraint.oid
tgdeferrableboolTrue if constraint trigger is deferrable
tginitdeferredboolTrue if constraint trigger is initially deferred
tgnargsint2Number of argument strings passed to trigger function
tgattrint2vectorColumn numbers, if trigger is column-specific; otherwise an empty array
pg_attribute.attnum
tgargsbyteaArgument strings to pass to trigger, each NULL-terminated
tgqualpg_node_treeExpression tree (in nodeToString() representation) for the trigger's WHEN condition, or null if none
tgoldtablenameREFERENCING clause name for OLD TABLE, or null if none
tgnewtablenameREFERENCING clause name for NEW TABLE, or null if none
Column history across versions
Version history 7
  1. PG 13 → 14changed
  2. PG 12 → 13changed
  3. PG 11 → 12changed
  4. PG 9.6 → 10changed
  5. PG 9.3 → 9.4changed
  6. PG 9.2 → 9.3changed
  7. PG 9.0 → 9.1changed

Definition snapshot: english-manuals:20eb64a7279380ef60b91c5bada… · English manual source