↑↓ select↵ open⌫ change scopeOpen full search

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

Wiki / System Catalogs

pg_trigger

The catalog pg_trigger stores triggers on tables and views. See CREATE TRIGGER for more information.

English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

kind
catalog
lang
en
measured attributes
true
metadata release
18.6
runtime columns
oid, tgrelid, tgparentid, tgname, tgfoid, tgtype, tgenabled, tgisinternal, tgconstrrelid, tgconstrindid, tgconstraint, tgdeferrable, tginitdeferred, tgnargs, tgattr, tgargs, tgqual, tgoldtable, tgnewtable
runtime verified
false
source
english-manual

Definition PG 18

The catalog pg_trigger stores triggers on tables and views. See CREATE TRIGGER for more information.

Catalog columns

ColumnTypeNullabilityDescription
oidoidNot nullRow identifier
tgrelidoidNot nullThe table this trigger is on
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
tgnamenameNot nullTrigger name (must be unique among triggers of same table)
tgfoidoidNot nullThe function to be called
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)
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)
tgconstraintoidNot nullThe pg_constraint entry associated with the trigger (zero if trigger is not for a constraint)
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
tgargsbyteaNot nullArgument strings to pass to trigger, each NULL-terminated
tgqualpg_node_treeNullableExpression tree (in nodeToString() representation) for the trigger's WHEN condition, or null if none
tgoldtablenameNullableREFERENCING clause name for OLD TABLE, or null if none
tgnewtablenameNullableREFERENCING clause name for NEW TABLE, or null if none

Compare versions

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · catalog-bilingual-repair:6d112b75167f6d406bc313c7b8a7a96772076549dcaa7c344cecf18bf8048308

Text language: en · catalog-bilingual-repair:6d112b75167f6d406bc313c7b8a7a96772076549dcaa7c344cecf18bf8048308