Documentazione di PostgreSQL 9.0 > Internal > System Catalogs > pg_trigger
Precedentepg_tablespacepg_ts_configSuccessivo

45.38. pg_trigger

The catalog pg_trigger stores triggers on tables. See CREATE TRIGGER(7) for more information.

Tabella 45.38. pg_trigger Columns

NameTypeReferencesDescription
tgrelidoidpg_class.oidThe table this trigger is on
tgnamename Trigger name (must be unique among triggers of same table)
tgfoidoidpg_proc.oidThe function to be called
tgtypeint2 Bit mask identifying trigger conditions
tgenabledchar  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.
tgisinternalbool True if trigger is internally generated (usually, to enforce the constraint identified by tgconstraint)
tgconstrrelidoidpg_class.oidThe table referenced by a referential integrity constraint
tgconstrindidoidpg_class.oidThe index supporting a unique, primary key, or referential integrity constraint
tgconstraintoidpg_constraint.oidThe pg_constraint entry associated with the trigger, if any
tgdeferrablebool True if constraint trigger is deferrable
tginitdeferredbool True if constraint trigger is initially deferred
tgnargsint2 Number of argument strings passed to trigger function
tgattrint2vectorpg_attribute.attnumColumn numbers, if trigger is column-specific; otherwise an empty array
tgargsbytea Argument strings to pass to trigger, each NULL-terminated
tgqualpg_node_tree Expression tree (in nodeToString() representation) for the trigger's WHEN condition, or null if none

Currently, column-specific triggering is supported only for UPDATE events, and so tgattr is relevant only for that event type. tgtype might contain bits for other event types as well, but those are presumed to be table-wide regardless of what is in tgattr.

[Nota]

Nota

When tgconstraint is nonzero, tgconstrrelid, tgconstrindid, tgdeferrable, and tginitdeferred are largely redundant with the referenced pg_constraint entry. However, it is possible for a non-deferrable trigger to be associated with a deferrable constraint: foreign key constraints can have some deferrable and some non-deferrable triggers.

[Nota]

Nota

pg_class.relhastriggers must be true if a table has any triggers in this catalog.

Documentazione di PostgreSQL 9.0 > Internal > System Catalogs > pg_trigger
Precedentepg_tablespacepg_ts_configSuccessivo