Skip to content
← Catalog atlas / pg_trigger

SYSTEM CATALOG · System catalog

pg_trigger

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

First seen PG 9.0Last seen PG 19Columns 19

Checked column by column against a PostgreSQL 18.6 instance · Raw measurement record ↗

Columns PostgreSQL 18

pg_trigger
COLUMNTYPEDESCRIPTION
oid oidNOT NULL Row identifier
tgrelid oidNOT NULL The table this trigger is onReferences:pg_class.oid
tgparentid oidNOT NULL Parent trigger that this trigger is cloned from (this happens when partitions are created or attached to a partitioned table); zero if not a cloneReferences:pg_trigger.oid
tgname nameNOT NULL Trigger name (must be unique among triggers of same table)
tgfoid oidNOT NULL The function to be calledReferences:pg_proc.oid
tgtype smallintNOT NULLDocumented as:int2 Bit mask identifying trigger firing conditions
tgenabled "char"NOT NULLDocumented as: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 booleanNOT NULLDocumented as:bool True if trigger is internally generated (usually, to enforce the constraint identified by tgconstraint)
tgconstrrelid oidNOT NULL The table referenced by a referential integrity constraint (zero if trigger is not for a referential integrity constraint)References:pg_class.oid
tgconstrindid oidNOT NULL The index supporting a unique, primary key, referential integrity, or exclusion constraint (zero if trigger is not for one of these types of constraint)References:pg_class.oid
tgconstraint oidNOT NULL The pg_constraint entry associated with the trigger (zero if trigger is not for a constraint)References:pg_constraint.oid
tgdeferrable booleanNOT NULLDocumented as:bool True if constraint trigger is deferrable
tginitdeferred booleanNOT NULLDocumented as:bool True if constraint trigger is initially deferred
tgnargs smallintNOT NULLDocumented as:int2 Number of argument strings passed to trigger function
tgattr int2vectorNOT NULL Column numbers, if trigger is column-specific; otherwise an empty arrayReferences:pg_attribute.attnum
tgargs byteaNOT NULL 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
tgoldtable name REFERENCING clause name for OLD TABLE, or null if none
tgnewtable name REFERENCING clause name for NEW TABLE, or null if none

Columns marked "implicit" are not included in SELECT *; some early statistics views are completed from same-version source, and the extra provenance is shown in the column description.

Common system columns 6

System attributes PostgreSQL provides, normally not expanded by SELECT *. Kept separately so they are not mixed in with ordinary columns.

ColumnsTypeattnum
tableoidoid-6
cmaxcid-5
xmaxxid-4
cmincid-3
xminxid-2
ctidtid-1

Column evolution matrix

Hover a cell for the column type
PresentAdded / type or attribute changeRemoved
COLUMN9.09.19.29.39.49.59.610111213141516171819
oid
tgrelid
tgname
tgfoid
tgtype
tgenabled
tgisinternal
tgconstrrelid
tgconstrindid
tgconstraint
tgdeferrable
tginitdeferred
tgnargs
tgattr
tgargs
tgqual
tgoldtable
tgnewtable
tgparentid

9.0 is the coverage baseline; a column already present in the baseline is not marked as added. The matrix aligns columns by name, so a rename appears as the old column removed and a new column added.

Evolution timeline

Changes between adjacent majors

PostgreSQL 14 ← 13

4 column description updates

PostgreSQL 13 ← 12

+ tgparentid

PostgreSQL 12 ← 11

~ oid: implicit → ordinary1 column description updates

PostgreSQL 10 ← 9.6

+ tgoldtable+ tgnewtable1 column description updates

PostgreSQL 9.5 ← 9.4

~ tgargs: not_null: false → true

PostgreSQL 9.4 ← 9.3

1 column description updates

PostgreSQL 9.3 ← 9.2

1 column description updates

PostgreSQL 9.1 ← 9.0

~ tgqual: text → pg_node_tree1 column description updatesCatalog description updated

Compare any two versions

Pick two versions to see added, removed, and retyped columns. The interactive comparison needs JavaScript; the evolution timeline reads fine without it.