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
| Column | Type | Nullability | Description |
|---|---|---|---|
| oid | oid | Not null | Row identifier |
| tgrelid | oid | Not null | The table this trigger is on |
| tgparentid | oid | Not 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 clone |
| tgname | name | Not null | Trigger name (must be unique among triggers of same table) |
| tgfoid | oid | Not null | The function to be called |
| tgtype | int2 | Not null | Bit mask identifying trigger firing conditions |
| tgenabled | char | Not null | 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 | bool | Not null | True if trigger is internally generated (usually, to enforce the constraint identified by tgconstraint) |
| tgconstrrelid | oid | Not null | The table referenced by a referential integrity constraint (zero if trigger is not for a referential integrity constraint) |
| tgconstrindid | oid | Not 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) |
| tgconstraint | oid | Not null | The pg_constraint entry associated with the trigger (zero if trigger is not for a constraint) |
| tgdeferrable | bool | Not null | True if constraint trigger is deferrable |
| tginitdeferred | bool | Not null | True if constraint trigger is initially deferred |
| tgnargs | int2 | Not null | Number of argument strings passed to trigger function |
| tgattr | int2vector | Not null | Column numbers, if trigger is column-specific; otherwise an empty array |
| tgargs | bytea | Not null | Argument strings to pass to trigger, each NULL-terminated |
| tgqual | pg_node_tree | Nullable | Expression tree (in nodeToString() representation) for the trigger's WHEN condition, or null if none |
| tgoldtable | name | Nullable | REFERENCING clause name for OLD TABLE, or null if none |
| tgnewtable | name | Nullable | REFERENCING 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