Updated on 2023-10-23 GMT+08:00

PG_TRIGGER

PG_TRIGGER records trigger information.

Table 1 PG_TRIGGER columns

Name

Type

Description

oid

oid

Row identifier (hidden attribute, which must be specified)

tgrelid

oid

OID of the table where the trigger is located

tgname

name

Trigger name

tgfoid

oid

Trigger OID

tgtype

smallint

Trigger type

tgenabled

"char"

O: The trigger is triggered in origin or local mode.

D: The trigger is disabled.

R: The trigger is triggered in replica mode.

A: The trigger is always triggered.

tgisinternal

boolean

Internal trigger ID. If the value is true, it indicates an internal trigger.

tgconstrrelid

oid

Table referenced by the integrity constraint

tgconstrindid

oid

Index of the integrity constraint

tgconstraint

oid

OID of the constraint trigger in PG_CONSTRAINT

tgdeferrable

boolean

Whether the constraint trigger is of the DEFERRABLE type

  • t (true): yes.
  • f (false): no.

tginitdeferred

boolean

Whether the trigger is of the INITIALLY DEFERRED type

  • t (true): yes.
  • f (false): no.

tgnargs

smallint

Number of input parameters of the trigger function

tgattr

int2vector

Column ID specified by the trigger. If no column is specified, an empty array is used.

tgargs

bytea

Parameter transferred to the trigger

tgqual

pg_node_tree

WHEN condition of the trigger (NULL if the WHEN condition does not exist)

tgowner

oid

Trigger owner