{"Entry":{"collection":"catalog","key":"pg_trigger","name":"pg_trigger","aliases":[],"metadata":{"changed_in":["8.3","9.0","9.1","9.5","10","12","13"],"changes":[{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"7.4","listing":[],"order":false,"removed":[],"status":"reworded","to":"8.0","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"True if trigger is enabled (not presently checked everywhere it should be, so disabling a trigger by setting this false does not work reliably)","name":"tgenabled","to":"True if trigger is enabled"}],"from":"8.0","listing":[],"order":false,"removed":[],"status":"reworded","to":"8.1","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Argument strings to pass to trigger, each null-terminated","name":"tgargs","to":"Argument strings to pass to trigger, each NULL-terminated"}],"from":"8.1","listing":[],"order":false,"removed":[],"status":"reworded","to":"8.2","types":[],"unlisted":[]},{"added":["tgconstraint"],"attributes":[],"description_changed":false,"descriptions":[{"from":"Referential integrity constraint name","name":"tgconstrname","to":"Constraint name, if a constraint trigger"},{"from":"The table referenced by an referential integrity constraint","name":"tgconstrrelid","to":"The table referenced by a referential integrity constraint"},{"from":"True if deferrable","name":"tgdeferrable","to":"True if constraint trigger is deferrable"},{"from":"True if trigger is enabled","name":"tgenabled","to":"Controls in which session_replication_role modes the trigger fires. O = trigger fires in \"origin\" and \"local\" modes, D = trigger is disabled, R = trigger fires in \"replica\" mode, A = trigger fires always."},{"from":"True if initially deferred","name":"tginitdeferred","to":"True if constraint trigger is initially deferred"},{"from":"True if trigger implements a referential integrity constraint","name":"tgisconstraint","to":"True if trigger is a \"constraint trigger\""}],"from":"8.2","listing":[],"order":false,"removed":[],"status":"changed","to":"8.3","types":[{"from":"bool","name":"tgenabled","to":"char"}],"unlisted":[]},{"added":["tgisinternal","tgconstrindid","tgqual"],"attributes":[],"description_changed":false,"descriptions":[{"from":"Currently unused","name":"tgattr","to":"Column numbers, if trigger is column-specific; otherwise an empty array"},{"from":"The pg_constraint entry owning the trigger, if any","name":"tgconstraint","to":"The pg_constraint entry associated with the trigger, if any"}],"from":"8.4","listing":[],"order":false,"removed":["tgisconstraint","tgconstrname"],"status":"changed","to":"9.0","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[{"from":"Bit mask identifying trigger conditions","name":"tgtype","to":"Bit mask identifying trigger firing conditions"}],"from":"9.0","listing":[],"order":false,"removed":[],"status":"changed","to":"9.1","types":[{"from":"text","name":"tgqual","to":"pg_node_tree"}],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"The index supporting a unique, primary key, or referential integrity constraint","name":"tgconstrindid","to":"The index supporting a unique, primary key, referential integrity, or exclusion constraint"}],"from":"9.3","listing":[],"order":false,"removed":[],"status":"reworded","to":"9.4","types":[],"unlisted":[]},{"added":[],"attributes":[{"attribute":"not_null","from":false,"name":"tgargs","to":true}],"description_changed":false,"descriptions":[],"from":"9.4","listing":[],"order":false,"removed":[],"status":"changed","to":"9.5","types":[],"unlisted":[]},{"added":["tgoldtable","tgnewtable"],"attributes":[],"description_changed":false,"descriptions":[{"from":"Controls in which session_replication_role modes the trigger fires. O = trigger fires in \"origin\" and \"local\" modes, D = trigger is disabled, R = trigger fires in \"replica\" mode, A = trigger fires always.","name":"tgenabled","to":"Controls in which session_replication_role modes the trigger fires. O = trigger fires in “origin” and “local” modes, D = trigger is disabled, R = trigger fires in “replica” mode, A = trigger fires always."}],"from":"9.6","listing":[],"order":false,"removed":[],"status":"changed","to":"10","types":[],"unlisted":[]},{"added":[],"attributes":[{"attribute":"hidden","from":true,"name":"oid","to":false}],"description_changed":false,"descriptions":[],"from":"11","listing":[],"order":false,"removed":[],"status":"changed","to":"12","types":[],"unlisted":[]},{"added":["tgparentid"],"attributes":[],"description_changed":false,"descriptions":[],"from":"12","listing":[],"order":false,"removed":[],"status":"changed","to":"13","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"The pg_constraint entry associated with the trigger, if any","name":"tgconstraint","to":"The pg_constraint entry associated with the trigger (zero if trigger is not for a constraint)"},{"from":"The index supporting a unique, primary key, referential integrity, or exclusion constraint","name":"tgconstrindid","to":"The index supporting a unique, primary key, referential integrity, or exclusion constraint (zero if trigger is not for one of these types of constraint)"},{"from":"The table referenced by a referential integrity constraint","name":"tgconstrrelid","to":"The table referenced by a referential integrity constraint (zero if trigger is not for a referential integrity constraint)"},{"from":"Parent trigger that this trigger is cloned from, zero if not a clone; this happens when partitions are created or attached to a partitioned table.","name":"tgparentid","to":"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"}],"from":"13","listing":[],"order":false,"removed":[],"status":"reworded","to":"14","types":[],"unlisted":[]}],"column_count":19,"content_hash":"3ef73fcfa6994ed61fb404f83edddc55956bbcb8ad822974f091980ffefb871d","first_version":"7.4","imported_at":"2026-09-30T00:40:56.287312+08:00","kind":"catalog","last_version":"20","name":"pg_trigger","position":143,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"relation_oid":null,"relkind":"r","shared":false,"source_rev":"english-manuals:53285c9d4f235a075a5b4dea0d946b0b907ae05afbc0856eb891436fe12419f0","summary":"The catalog pg_trigger stores triggers on tables and views.","summary_zh":""}},"Definition":{"Collection":"catalog","Key":"pg_trigger","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_trigger","SourceRevision":"english-manuals:53285c9d4f235a075a5b4dea0d946b0b907ae05afbc0856eb891436fe12419f0","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"Row identifier","description_zh":"","documented":true,"documented_name":"oid","hidden":false,"name":"oid","not_null":true,"references":"","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":2,"description":"The table this trigger is on","description_zh":"","documented":true,"documented_name":"tgrelid","hidden":false,"name":"tgrelid","not_null":true,"references":"pg_class.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":3,"description":"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","description_zh":"","documented":true,"documented_name":"tgparentid","hidden":false,"name":"tgparentid","not_null":true,"references":"pg_trigger.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":4,"description":"Trigger name (must be unique among triggers of same table)","description_zh":"","documented":true,"documented_name":"tgname","hidden":false,"name":"tgname","not_null":true,"references":"","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":5,"description":"The function to be called","description_zh":"","documented":true,"documented_name":"tgfoid","hidden":false,"name":"tgfoid","not_null":true,"references":"pg_proc.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":6,"description":"Bit mask identifying trigger firing conditions","description_zh":"","documented":true,"documented_name":"tgtype","hidden":false,"name":"tgtype","not_null":true,"references":"","type":"int2","type_modifier":-1,"type_oid":21},{"array_dimensions":0,"attnum":7,"description":"Controls in which session_replication_role modes the trigger fires. O = trigger fires in “origin” and “local” modes, D = trigger is disabled, R = trigger fires in “replica” mode, A = trigger fires always.","description_zh":"","documented":true,"documented_name":"tgenabled","hidden":false,"name":"tgenabled","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":8,"description":"True if trigger is internally generated (usually, to enforce the constraint identified by tgconstraint)","description_zh":"","documented":true,"documented_name":"tgisinternal","hidden":false,"name":"tgisinternal","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":9,"description":"The table referenced by a referential integrity constraint (zero if trigger is not for a referential integrity constraint)","description_zh":"","documented":true,"documented_name":"tgconstrrelid","hidden":false,"name":"tgconstrrelid","not_null":true,"references":"pg_class.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":10,"description":"The index supporting a unique, primary key, referential integrity, or exclusion constraint (zero if trigger is not for one of these types of constraint)","description_zh":"","documented":true,"documented_name":"tgconstrindid","hidden":false,"name":"tgconstrindid","not_null":true,"references":"pg_class.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":11,"description":"The pg_constraint entry associated with the trigger (zero if trigger is not for a constraint)","description_zh":"","documented":true,"documented_name":"tgconstraint","hidden":false,"name":"tgconstraint","not_null":true,"references":"pg_constraint.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":12,"description":"True if constraint trigger is deferrable","description_zh":"","documented":true,"documented_name":"tgdeferrable","hidden":false,"name":"tgdeferrable","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":13,"description":"True if constraint trigger is initially deferred","description_zh":"","documented":true,"documented_name":"tginitdeferred","hidden":false,"name":"tginitdeferred","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":14,"description":"Number of argument strings passed to trigger function","description_zh":"","documented":true,"documented_name":"tgnargs","hidden":false,"name":"tgnargs","not_null":true,"references":"","type":"int2","type_modifier":-1,"type_oid":21},{"array_dimensions":1,"attnum":15,"description":"Column numbers, if trigger is column-specific; otherwise an empty array","description_zh":"","documented":true,"documented_name":"tgattr","hidden":false,"name":"tgattr","not_null":true,"references":"pg_attribute.attnum","type":"int2vector","type_modifier":-1,"type_oid":22},{"array_dimensions":0,"attnum":16,"description":"Argument strings to pass to trigger, each NULL-terminated","description_zh":"","documented":true,"documented_name":"tgargs","hidden":false,"name":"tgargs","not_null":true,"references":"","type":"bytea","type_modifier":-1,"type_oid":17},{"array_dimensions":0,"attnum":17,"description":"Expression tree (in nodeToString() representation) for the trigger's WHEN condition, or null if none","description_zh":"","documented":true,"documented_name":"tgqual","hidden":false,"name":"tgqual","not_null":false,"references":"","type":"pg_node_tree","type_modifier":-1,"type_oid":194},{"array_dimensions":0,"attnum":18,"description":"REFERENCING clause name for OLD TABLE, or null if none","description_zh":"","documented":true,"documented_name":"tgoldtable","hidden":false,"name":"tgoldtable","not_null":false,"references":"","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":19,"description":"REFERENCING clause name for NEW TABLE, or null if none","description_zh":"","documented":true,"documented_name":"tgnewtable","hidden":false,"name":"tgnewtable","not_null":false,"references":"","type":"name","type_modifier":-1,"type_oid":19}],"description":"The catalog pg_trigger stores triggers on tables and views. See CREATE TRIGGER for more information.","description_zh":"","doc":{"anchor":"id-1.10.4.60.4","file":"catalog-pg-trigger.html","lang":"en","sha256":"e418d8db3feacc58b50f738295883012acddcf3205073d0646634432cdc0104a","slug":"18"},"kind":"catalog","lang":"en","measured_attributes":true,"metadata_release":"18.6","runtime_columns":["oid","tgrelid","tgparentid","tgname","tgfoid","tgtype","tgenabled","tgisinternal","tgconstrrelid","tgconstrindid","tgconstraint","tgdeferrable","tginitdeferred","tgnargs","tgattr","tgargs","tgqual","tgoldtable","tgnewtable"],"runtime_verified":false,"source":"english-manual"},"ManualEvidence":{"doc":{"anchor":"id-1.10.4.60.4","file":"catalog-pg-trigger.html","lang":"en","sha256":"e418d8db3feacc58b50f738295883012acddcf3205073d0646634432cdc0104a","slug":"18"}},"MeasuredEvidence":{"measured_attributes":true,"metadata_release":"18.6","runtime_columns":["oid","tgrelid","tgparentid","tgname","tgfoid","tgtype","tgenabled","tgisinternal","tgconstrrelid","tgconstrindid","tgconstraint","tgdeferrable","tginitdeferred","tgnargs","tgattr","tgargs","tgqual","tgoldtable","tgnewtable"],"runtime_verified":false}},"Text":{"Collection":"catalog","Key":"pg_trigger","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_trigger","Summary":"目录pg_trigger存储表和视图上的触发器。详见CREATE TRIGGER。","BodyHTML":"\u003cp\u003e目录pg_trigger存储表和视图上的触发器。详见CREATE TRIGGER。\u003c/p\u003e","SourceRevision":"2026-09-27@419045e","ContentHash":"bb14f68ef104f6889300c31d1a44480697e4c533391fc89dff35af86f97b84ef","Payload":{"columns":[{"description_zh":"行标识符","name":"oid","type":"oid","zh_from":"doc"},{"description_zh":"触发器所在的表","name":"tgrelid","type":"oid","zh_from":"doc"},{"description_zh":"该触发器克隆自的父触发器（这种情况发生在创建分区或将其附加到分区表时）；如果不是克隆，则为零","name":"tgparentid","type":"oid","zh_from":"doc"},{"description_zh":"触发器名（在同一个表的触发器中必须唯一）","name":"tgname","type":"name","zh_from":"doc"},{"description_zh":"要被触发器调用的函数","name":"tgfoid","type":"oid","zh_from":"doc"},{"description_zh":"标识触发器触发条件的位掩码","name":"tgtype","type":"smallint","zh_from":"doc"},{"description_zh":"控制触发器在session_replication_role模式中的触发。O = 触发器在“origin”和“local”模式触发，D = 触发器被禁用，R = 触发器在“replica”模式触发，A = 触发器总是触发。","name":"tgenabled","type":"\"char\"","zh_from":"doc"},{"description_zh":"为真表示触发器是内部生成的（通常是为了强制执行由tgconstraint指定的约束）","name":"tgisinternal","type":"boolean","zh_from":"doc"},{"description_zh":"被一个引用完整性约束引用的表（如果触发器不是针对一个引用完整性约束则为零）","name":"tgconstrrelid","type":"oid","zh_from":"doc"},{"description_zh":"支持一个唯一、主键、引用完整性约束或者排除约束的索引（如果触发器不是针对这些约束类型中的一个则为零）","name":"tgconstrindid","type":"oid","zh_from":"doc"},{"description_zh":"与触发器相关的pg_constraint项（如果触发器不用于约束则为零）","name":"tgconstraint","type":"oid","zh_from":"doc"},{"description_zh":"如果约束触发器可延迟则为真","name":"tgdeferrable","type":"boolean","zh_from":"doc"},{"description_zh":"如果约束触发器初始处于延迟状态则为真","name":"tginitdeferred","type":"boolean","zh_from":"doc"},{"description_zh":"传递给触发器函数的参数字符串个数","name":"tgnargs","type":"smallint","zh_from":"doc"},{"description_zh":"如果触发器是列限定的，这里存放列号；否则这是一个空数组","name":"tgattr","type":"int2vector","zh_from":"doc"},{"description_zh":"传递给触发器的参数字符串，每一个都以NULL结尾","name":"tgargs","type":"bytea","zh_from":"doc"},{"description_zh":"触发器WHEN条件的表达式树（以nodeToString()表示）；如果没有则为 NULL","name":"tgqual","type":"pg_node_tree","zh_from":"doc"},{"description_zh":"OLD TABLE 在 REFERENCING 子句中指定的名称；如果没有，则为 NULL","name":"tgoldtable","type":"name","zh_from":"doc"},{"description_zh":"NEW TABLE 在 REFERENCING 子句中指定的名称；如果没有，则为 NULL","name":"tgnewtable","type":"name","zh_from":"doc"}],"description_zh":"目录pg_trigger存储表和视图上的触发器。详见CREATE TRIGGER。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
