↑↓ 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.

Reading PG 18current·documented in 24 of 24 versions, 7.4 to 20

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

Columns 19

As listed in the PostgreSQL 18 manual.

ColumnTypeDescription / reference
oidoidNOT NULLRow identifier
tgrelidoidNOT NULLThe table this trigger is on
pg_class.oid
tgparentidoidNOT NULLParent trigger that this trigger is cloned from (this happens when partitions are created or attached to a partitioned table); zero if not a clone
pg_trigger.oid
tgnamenameNOT NULLTrigger name (must be unique among triggers of same table)
tgfoidoidNOT NULLThe function to be called
pg_proc.oid
tgtypeint2NOT NULLBit mask identifying trigger firing conditions
tgenabledcharNOT NULLControls 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.
tgisinternalboolNOT NULLTrue if trigger is internally generated (usually, to enforce the constraint identified by tgconstraint)
tgconstrrelidoidNOT NULLThe table referenced by a referential integrity constraint (zero if trigger is not for a referential integrity constraint)
pg_class.oid
tgconstrindidoidNOT NULLThe 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
tgconstraintoidNOT NULLThe pg_constraint entry associated with the trigger (zero if trigger is not for a constraint)
pg_constraint.oid
tgdeferrableboolNOT NULLTrue if constraint trigger is deferrable
tginitdeferredboolNOT NULLTrue if constraint trigger is initially deferred
tgnargsint2NOT NULLNumber of argument strings passed to trigger function
tgattrint2vectorNOT NULLColumn numbers, if trigger is column-specific; otherwise an empty array
pg_attribute.attnum
tgargsbyteaNOT NULLArgument 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 12
  1. 13 → 14 reworded
  2. 12 → 13 changed
  3. 11 → 12 changed
  4. 9.6 → 10 changed
  5. 9.4 → 9.5 changed
  6. 9.3 → 9.4 reworded
  7. 9.0 → 9.1 changed
  8. 8.4 → 9.0 changed
  9. 8.2 → 8.3 changed
  10. 8.1 → 8.2 reworded
  11. 8.0 → 8.1 reworded
  12. 7.4 → 8.0 reworded

Definition snapshot: english-manuals:53285c9d4f235a075a5b4dea0d9… · English manual source