Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
51.60. pg_trigger
Prev UpChapter 51. System CatalogsHome Next

51.60. pg_trigger#

The catalogpg_trigger stores triggers on tables and views. SeeCREATE TRIGGER for more information.

Table 51.60. pg_trigger Columns

Column Type

Description

oidoid

Row identifier

tgrelidoid (referencespg_class.oid)

The table this trigger is on

tgparentidoid (referencespg_trigger.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

tgnamename

Trigger name (must be unique among triggers of same table)

tgfoidoid (referencespg_proc.oid)

The function to be called

tgtypeint2

Bit mask identifying trigger firing conditions

tgenabledchar

Controls in whichsession_replication_role modes the trigger fires.O = trigger fires inorigin andlocal modes,D = trigger is disabled,R = trigger fires inreplica mode,A = trigger fires always.

tgisinternalbool

True if trigger is internally generated (usually, to enforce the constraint identified bytgconstraint)

tgconstrrelidoid (referencespg_class.oid)

The table referenced by a referential integrity constraint (zero if trigger is not for a referential integrity constraint)

tgconstrindidoid (referencespg_class.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)

tgconstraintoid (referencespg_constraint.oid)

Thepg_constraint entry associated with the trigger (zero if trigger is not for a constraint)

tgdeferrablebool

True if constraint trigger is deferrable

tginitdeferredbool

True if constraint trigger is initially deferred

tgnargsint2

Number of argument strings passed to trigger function

tgattrint2vector (referencespg_attribute.attnum)

Column 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 (innodeToString() representation) for the trigger'sWHEN condition, or null if none

tgoldtablename

REFERENCING clause name forOLD TABLE, or null if none

tgnewtablename

REFERENCING clause name forNEW TABLE, or null if none


Currently, column-specific triggering is supported only forUPDATE events, and sotgattr 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 intgattr.

Note

Whentgconstraint is nonzero,tgconstrrelid,tgconstrindid,tgdeferrable, andtginitdeferred are largely redundant with the referencedpg_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.

Note

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


Prev Up Next
51.59. pg_transform Home 51.61. pg_ts_config
pdfepub
Go to Postgres Pro Standard 17
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp