pg_trigger

用于存储触发器信息的系统表

pg_trigger 是一个用于存储触发器信息的系统目录表。

pg_trigger 添加于PostgreSQL 6.2

按 PostgreSQL 版本定义

pg_trigger (PostgreSQL 17)

                 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)
    

文档: pg_trigger

pg_trigger (PostgreSQL 16)

                 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)
    

文档: pg_trigger

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)
    

文档: 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)
    

文档: 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)
    

文档: 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)
    

文档: 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)
    

文档: 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)
    

文档: 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)
    

文档: 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)
    

文档: 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)
    

文档: 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)
    

文档: 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)
    

文档: 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)
    

文档: 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)
    

文档: 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)
    

文档: 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)
    

文档: 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)
    

文档: pg_trigger

更改历史记录

分类

DDL系统目录触发器

另请参阅

pg_constraintpg_event_triggerpg_trigger_depth()

反馈

提交任何关于“pg_trigger”的评论、建议或更正 此处