pg_trigger
pg_trigger
is a system catalogue table used to store information about triggers.
pg_trigger
was added in PostgreSQL 6.2.
Definition by PostgreSQL version
pg_trigger (PostgreSQL 15)
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" PRIMARY KEY, btree (oid) "pg_trigger_tgconstraint_index" btree (tgconstraint) "pg_trigger_tgrelid_tgname_index" UNIQUE CONSTRAINT, btree (tgrelid, tgname)
Documentation: pg_trigger
pg_trigger (PostgreSQL 14)
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" PRIMARY KEY, btree (oid) "pg_trigger_tgconstraint_index" btree (tgconstraint) "pg_trigger_tgrelid_tgname_index" UNIQUE CONSTRAINT, btree (tgrelid, tgname)
Documentation: pg_trigger
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
- PostgreSQL 13
- column
tgparentid
added (commit b9b408c4)
- column
- PostgreSQL 10
- columns
tgoldtable
andtgnewtable
added (commit 8c48375e)
- columns
- PostgreSQL 9.5
- column
tgargs
set toNOT NULL
(commit 82a532b3)
- column
- PostgreSQL 9.1
- type of column
tgqual
changed fromTEXT
topg_node_tree
(commit 303696c3)
- type of column
- PostgreSQL 9.0
- PostgreSQL 8.3
- PostgreSQL 7.3
- column
tgname
must be unique among triggers of same table (commit unknown)
- column
- PostgreSQL 6.2
- added (commit 2d7b93c0)
References
- PostgreSQL documentation: pg_trigger