pg_trigger

A system catalogue table used to store information about triggers

pg_trigger is a system catalogue table used to store information about triggers.

pg_trigger was added in PostgreSQL 6.2 (commit 2d7b93c0).

Definition by PostgreSQL version

pg_trigger (PostgreSQL 13)

                 Table "pg_catalog.pg_trigger"
     Column     |     Type     | Collation | Nullable | Default
----------------+--------------+-----------+----------+---------
 oid            | oid          |           | not null |
 tgrelid        | oid          |           | not null |
 tgparentid     | oid          |           | not null |
 tgname         | name         |           | not null |
 tgfoid         | oid          |           | not null |
 tgtype         | smallint     |           | not null |
 tgenabled      | "char"       |           | not null |
 tgisinternal   | boolean      |           | not null |
 tgconstrrelid  | oid          |           | not null |
 tgconstrindid  | oid          |           | not null |
 tgconstraint   | oid          |           | not null |
 tgdeferrable   | boolean      |           | not null |
 tginitdeferred | boolean      |           | not null |
 tgnargs        | smallint     |           | not null |
 tgattr         | int2vector   |           | not null |
 tgargs         | bytea        |           | not null |
 tgqual         | pg_node_tree | C         |          |
 tgoldtable     | name         |           |          |
 tgnewtable     | name         |           |          |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgconstraint_index" btree (tgconstraint)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    

Documentation: pg_trigger

pg_trigger (PostgreSQL 12)

                 Table "pg_catalog.pg_trigger"
     Column     |     Type     | Collation | Nullable | Default
----------------+--------------+-----------+----------+---------
 oid            | oid          |           | not null |
 tgrelid        | oid          |           | not null |
 tgname         | name         |           | not null |
 tgfoid         | oid          |           | not null |
 tgtype         | smallint     |           | not null |
 tgenabled      | "char"       |           | not null |
 tgisinternal   | boolean      |           | not null |
 tgconstrrelid  | oid          |           | not null |
 tgconstrindid  | oid          |           | not null |
 tgconstraint   | oid          |           | not null |
 tgdeferrable   | boolean      |           | not null |
 tginitdeferred | boolean      |           | not null |
 tgnargs        | smallint     |           | not null |
 tgattr         | int2vector   |           | not null |
 tgargs         | bytea        |           | not null |
 tgqual         | pg_node_tree | C         |          |
 tgoldtable     | name         |           |          |
 tgnewtable     | name         |           |          |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    "pg_trigger_tgconstraint_index" btree (tgconstraint)
    

Documentation: pg_trigger

pg_trigger (PostgreSQL 11)

                 Table "pg_catalog.pg_trigger"
     Column     |     Type     | Collation | Nullable | Default
----------------+--------------+-----------+----------+---------
 tgrelid        | oid          |           | not null |
 tgname         | name         |           | not null |
 tgfoid         | oid          |           | not null |
 tgtype         | smallint     |           | not null |
 tgenabled      | "char"       |           | not null |
 tgisinternal   | boolean      |           | not null |
 tgconstrrelid  | oid          |           | not null |
 tgconstrindid  | oid          |           | not null |
 tgconstraint   | oid          |           | not null |
 tgdeferrable   | boolean      |           | not null |
 tginitdeferred | boolean      |           | not null |
 tgnargs        | smallint     |           | not null |
 tgattr         | int2vector   |           | not null |
 tgargs         | bytea        |           | not null |
 tgqual         | pg_node_tree |           |          |
 tgoldtable     | name         |           |          |
 tgnewtable     | name         |           |          |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    "pg_trigger_tgconstraint_index" btree (tgconstraint)
    

Documentation: pg_trigger

pg_trigger (PostgreSQL 10)

                 Table "pg_catalog.pg_trigger"
     Column     |     Type     | Collation | Nullable | Default
----------------+--------------+-----------+----------+---------
 tgrelid        | oid          |           | not null |
 tgname         | name         |           | not null |
 tgfoid         | oid          |           | not null |
 tgtype         | smallint     |           | not null |
 tgenabled      | "char"       |           | not null |
 tgisinternal   | boolean      |           | not null |
 tgconstrrelid  | oid          |           | not null |
 tgconstrindid  | oid          |           | not null |
 tgconstraint   | oid          |           | not null |
 tgdeferrable   | boolean      |           | not null |
 tginitdeferred | boolean      |           | not null |
 tgnargs        | smallint     |           | not null |
 tgattr         | int2vector   |           | not null |
 tgargs         | bytea        |           | not null |
 tgqual         | pg_node_tree |           |          |
 tgoldtable     | name         |           |          |
 tgnewtable     | name         |           |          |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    "pg_trigger_tgconstraint_index" btree (tgconstraint)
    

Documentation: pg_trigger

pg_trigger (PostgreSQL 9.6)

       Table "pg_catalog.pg_trigger"
     Column     |     Type     | Modifiers
----------------+--------------+-----------
 tgrelid        | oid          | not null
 tgname         | name         | not null
 tgfoid         | oid          | not null
 tgtype         | smallint     | not null
 tgenabled      | "char"       | not null
 tgisinternal   | boolean      | not null
 tgconstrrelid  | oid          | not null
 tgconstrindid  | oid          | not null
 tgconstraint   | oid          | not null
 tgdeferrable   | boolean      | not null
 tginitdeferred | boolean      | not null
 tgnargs        | smallint     | not null
 tgattr         | int2vector   | not null
 tgargs         | bytea        | not null
 tgqual         | pg_node_tree |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    "pg_trigger_tgconstraint_index" btree (tgconstraint)
    

Documentation: pg_trigger

pg_trigger (PostgreSQL 9.5)

       Table "pg_catalog.pg_trigger"
     Column     |     Type     | Modifiers
----------------+--------------+-----------
 tgrelid        | oid          | not null
 tgname         | name         | not null
 tgfoid         | oid          | not null
 tgtype         | smallint     | not null
 tgenabled      | "char"       | not null
 tgisinternal   | boolean      | not null
 tgconstrrelid  | oid          | not null
 tgconstrindid  | oid          | not null
 tgconstraint   | oid          | not null
 tgdeferrable   | boolean      | not null
 tginitdeferred | boolean      | not null
 tgnargs        | smallint     | not null
 tgattr         | int2vector   | not null
 tgargs         | bytea        | not null
 tgqual         | pg_node_tree |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    "pg_trigger_tgconstraint_index" btree (tgconstraint)
    

Documentation: pg_trigger

pg_trigger (PostgreSQL 9.4)

       Table "pg_catalog.pg_trigger"
     Column     |     Type     | Modifiers
----------------+--------------+-----------
 tgrelid        | oid          | not null
 tgname         | name         | not null
 tgfoid         | oid          | not null
 tgtype         | smallint     | not null
 tgenabled      | "char"       | not null
 tgisinternal   | boolean      | not null
 tgconstrrelid  | oid          | not null
 tgconstrindid  | oid          | not null
 tgconstraint   | oid          | not null
 tgdeferrable   | boolean      | not null
 tginitdeferred | boolean      | not null
 tgnargs        | smallint     | not null
 tgattr         | int2vector   | not null
 tgargs         | bytea        |
 tgqual         | pg_node_tree |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    "pg_trigger_tgconstraint_index" btree (tgconstraint)
    

Documentation: pg_trigger

pg_trigger (PostgreSQL 9.3)

       Table "pg_catalog.pg_trigger"
     Column     |     Type     | Modifiers
----------------+--------------+-----------
 tgrelid        | oid          | not null
 tgname         | name         | not null
 tgfoid         | oid          | not null
 tgtype         | smallint     | not null
 tgenabled      | "char"       | not null
 tgisinternal   | boolean      | not null
 tgconstrrelid  | oid          | not null
 tgconstrindid  | oid          | not null
 tgconstraint   | oid          | not null
 tgdeferrable   | boolean      | not null
 tginitdeferred | boolean      | not null
 tgnargs        | smallint     | not null
 tgattr         | int2vector   | not null
 tgargs         | bytea        |
 tgqual         | pg_node_tree |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    "pg_trigger_tgconstraint_index" btree (tgconstraint)
    

Documentation: pg_trigger

pg_trigger (PostgreSQL 9.2)

       Table "pg_catalog.pg_trigger"
     Column     |     Type     | Modifiers
----------------+--------------+-----------
 tgrelid        | oid          | not null
 tgname         | name         | not null
 tgfoid         | oid          | not null
 tgtype         | smallint     | not null
 tgenabled      | "char"       | not null
 tgisinternal   | boolean      | not null
 tgconstrrelid  | oid          | not null
 tgconstrindid  | oid          | not null
 tgconstraint   | oid          | not null
 tgdeferrable   | boolean      | not null
 tginitdeferred | boolean      | not null
 tgnargs        | smallint     | not null
 tgattr         | int2vector   | not null
 tgargs         | bytea        |
 tgqual         | pg_node_tree |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    "pg_trigger_tgconstraint_index" btree (tgconstraint)
    

Documentation: pg_trigger

pg_trigger (PostgreSQL 9.1)

       Table "pg_catalog.pg_trigger"
     Column     |     Type     | Modifiers
----------------+--------------+-----------
 tgrelid        | oid          | not null
 tgname         | name         | not null
 tgfoid         | oid          | not null
 tgtype         | smallint     | not null
 tgenabled      | "char"       | not null
 tgisinternal   | boolean      | not null
 tgconstrrelid  | oid          | not null
 tgconstrindid  | oid          | not null
 tgconstraint   | oid          | not null
 tgdeferrable   | boolean      | not null
 tginitdeferred | boolean      | not null
 tgnargs        | smallint     | not null
 tgattr         | int2vector   | not null
 tgargs         | bytea        |
 tgqual         | pg_node_tree |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    "pg_trigger_tgconstraint_index" btree (tgconstraint)
    

Documentation: pg_trigger

pg_trigger (PostgreSQL 9.0)

      Table "pg_catalog.pg_trigger"
     Column     |    Type    | Modifiers
----------------+------------+-----------
 tgrelid        | oid        | not null
 tgname         | name       | not null
 tgfoid         | oid        | not null
 tgtype         | smallint   | not null
 tgenabled      | "char"     | not null
 tgisinternal   | boolean    | not null
 tgconstrrelid  | oid        | not null
 tgconstrindid  | oid        | not null
 tgconstraint   | oid        | not null
 tgdeferrable   | boolean    | not null
 tginitdeferred | boolean    | not null
 tgnargs        | smallint   | not null
 tgattr         | int2vector | not null
 tgargs         | bytea      |
 tgqual         | text       |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    "pg_trigger_tgconstraint_index" btree (tgconstraint)
    

Documentation: pg_trigger

pg_trigger (PostgreSQL 8.4)

      Table "pg_catalog.pg_trigger"
     Column     |    Type    | Modifiers
----------------+------------+-----------
 tgrelid        | oid        | not null
 tgname         | name       | not null
 tgfoid         | oid        | not null
 tgtype         | smallint   | not null
 tgenabled      | "char"     | not null
 tgisconstraint | boolean    | not null
 tgconstrname   | name       | not null
 tgconstrrelid  | oid        | not null
 tgconstraint   | oid        | not null
 tgdeferrable   | boolean    | not null
 tginitdeferred | boolean    | not null
 tgnargs        | smallint   | not null
 tgattr         | int2vector | not null
 tgargs         | bytea      |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    "pg_trigger_tgconstrname_index" btree (tgconstrname)
    

Documentation: pg_trigger

pg_trigger (PostgreSQL 8.3)

      Table "pg_catalog.pg_trigger"
     Column     |    Type    | Modifiers
----------------+------------+-----------
 tgrelid        | oid        | not null
 tgname         | name       | not null
 tgfoid         | oid        | not null
 tgtype         | smallint   | not null
 tgenabled      | "char"     | not null
 tgisconstraint | boolean    | not null
 tgconstrname   | name       | not null
 tgconstrrelid  | oid        | not null
 tgconstraint   | oid        | not null
 tgdeferrable   | boolean    | not null
 tginitdeferred | boolean    | not null
 tgnargs        | smallint   | not null
 tgattr         | int2vector | not null
 tgargs         | bytea      |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    "pg_trigger_tgconstrname_index" btree (tgconstrname)
    

Documentation: pg_trigger

pg_trigger (PostgreSQL 8.2)

      Table "pg_catalog.pg_trigger"
     Column     |    Type    | Modifiers
----------------+------------+-----------
 tgrelid        | oid        | not null
 tgname         | name       | not null
 tgfoid         | oid        | not null
 tgtype         | smallint   | not null
 tgenabled      | boolean    | not null
 tgisconstraint | boolean    | not null
 tgconstrname   | name       | not null
 tgconstrrelid  | oid        | not null
 tgdeferrable   | boolean    | not null
 tginitdeferred | boolean    | not null
 tgnargs        | smallint   | not null
 tgattr         | int2vector | not null
 tgargs         | bytea      |
Indexes:
    "pg_trigger_oid_index" UNIQUE, btree (oid)
    "pg_trigger_tgrelid_tgname_index" UNIQUE, btree (tgrelid, tgname)
    "pg_trigger_tgconstrname_index" btree (tgconstrname)
    "pg_trigger_tgconstrrelid_index" btree (tgconstrrelid)
    

Documentation: pg_trigger

Change history

Categories

DDL, System catalogue, Trigger

See also

pg_constraint, pg_event_trigger