SYSTEM CATALOGS / SYSTEM CATALOGS
pg_trigger
Read PG 18 manual ↗The catalog pg_trigger stores triggers on tables and views.
- Kind
- System catalogs
- Columns in this snapshot
- 19
- Definition source
- English manual
Columns 19
| Column | Type | Description / reference |
|---|---|---|
oid | oid | Row identifier |
tgrelid | oid | The table this trigger is on pg_class.oid |
tgparentid | oid | 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 | Trigger name (must be unique among triggers of same table) |
tgfoid | oid | The function to be called pg_proc.oid |
tgtype | int2 | Bit mask identifying trigger firing conditions |
tgenabled | 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 | bool | True if trigger is internally generated (usually, to enforce the constraint identified by tgconstraint) |
tgconstrrelid | oid | The table referenced by a referential integrity constraint (zero if trigger is not for a referential integrity constraint) pg_class.oid |
tgconstrindid | oid | The 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 |
tgconstraint | oid | The pg_constraint entry associated with the trigger (zero if trigger is not for a constraint) pg_constraint.oid |
tgdeferrable | bool | True if constraint trigger is deferrable |
tginitdeferred | bool | True if constraint trigger is initially deferred |
tgnargs | int2 | Number of argument strings passed to trigger function |
tgattr | int2vector | Column numbers, if trigger is column-specific; otherwise an empty array pg_attribute.attnum |
tgargs | bytea | 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 |
Column history across versions
| Column | 9.0 | 9.1 | 9.2 | 9.3 | 9.4 | 9.5 | 9.6 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
oid | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgrelid | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgname | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgfoid | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgtype | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgenabled | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgisinternal | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgconstrrelid | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgconstrindid | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgconstraint | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgdeferrable | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tginitdeferred | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgnargs | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgattr | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgargs | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgqual | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgoldtable | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgnewtable | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
tgparentid | · | · | · | · | · | · | · | · | · | · | ● | ● | ● | ● | ● | ● | ● | ● |
Version history 7
- PG 13 → 14changed
- PG 12 → 13changed
- PG 11 → 12changed
- PG 9.6 → 10changed
- PG 9.3 → 9.4changed
- PG 9.2 → 9.3changed
- PG 9.0 → 9.1changed
Definition snapshot: english-manuals:20eb64a7279380ef60b91c5bada… · English manual source