PostgreSQL 14 ← 13
SYSTEM CATALOG · System catalog
pg_trigger
The catalog pg_trigger stores triggers on tables and views. See CREATE TRIGGER for more information.
Checked column by column against a PostgreSQL 18.6 instance · Raw measurement record ↗
Columns PostgreSQL 18
pg_trigger| COLUMN | TYPE | DESCRIPTION |
|---|---|---|
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.
| Columns | Type | attnum |
|---|---|---|
tableoid | oid | -6 |
cmax | cid | -5 |
xmax | xid | -4 |
cmin | cid | -3 |
xmin | xid | -2 |
ctid | tid | -1 |
Column evolution matrix
Hover a cell for the column type9.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 majorsPostgreSQL 13 ← 12
PostgreSQL 12 ← 11
PostgreSQL 10 ← 9.6
PostgreSQL 9.5 ← 9.4
PostgreSQL 9.4 ← 9.3
PostgreSQL 9.3 ← 9.2
PostgreSQL 9.1 ← 9.0
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.