{"Entry":{"collection":"sql","key":"drop-trigger","name":"DROP TRIGGER","aliases":["droptrigger"],"metadata":{"aliases":["droptrigger"],"changed_in":["7.3","8.2","9.2"],"changes":[{"from":"7.0","purpose_changed":false,"renamed":{"from_file":"sql-droptrigger.htm","to_file":"sql-droptrigger.html"},"sections":{"added":[],"changed":[],"removed":[]},"status":"changed","synopsis":null,"to":"7.1"},{"from":"7.1","purpose_changed":true,"renamed":null,"sections":{"added":["examples","see_also"],"changed":["description","compatibility"],"removed":["usage"]},"status":"changed","synopsis":null,"to":"7.2"},{"from":"7.2","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["description"],"removed":[]},"status":"changed","synopsis":{"added":["DROP TRIGGER name ON table [ CASCADE | RESTRICT ]"],"removed":[]},"to":"7.3"},{"from":"7.3","purpose_changed":false,"renamed":null,"sections":{"added":["parameters"],"changed":["description","examples","compatibility"],"removed":[]},"status":"changed","synopsis":null,"to":"7.4"},{"from":"7.4","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"8.0"},{"from":"8.1","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":{"added":["DROP TRIGGER [ IF EXISTS ] name ON table [ CASCADE | RESTRICT ]"],"removed":[]},"to":"8.2"},{"from":"8.2","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["description"],"removed":[]},"status":"changed","synopsis":null,"to":"8.3"},{"from":"9.1","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":{"added":["DROP TRIGGER [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]"],"removed":["DROP TRIGGER [ IF EXISTS ] name ON table [ CASCADE | RESTRICT ]"]},"to":"9.2"},{"from":"9.5","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"9.6"},{"from":"11","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"12"},{"from":"16","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"17"},{"from":"18","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":["parameters"],"removed":[]},"status":"changed","synopsis":null,"to":"19"}],"content_hash":"fa1813f8664d85277c4df406453e502f5ab5383f5187d74b150cd331753194d7","derived_content_hash":"9d0e095470a5204010c57f23e948d3b7648bc2321c0063ce85fe8bf7fed5d6f4","editorial":{},"first_version":"6.4","group":"trigger","imported_at":"2026-09-30T17:43:38.482524+08:00","last_version":"20","name":"DROP TRIGGER","object":"TRIGGER","position":6009,"present_in":["6.4","6.5","7.0","7.1","7.2","7.3","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"],"purpose":"remove a trigger","purpose_zh":"","related":["create-trigger"],"repair_provenance":{"original_source_revision":"wiki-repair-20261023:dfdede6fbc6444d5373d5ec7f9985bc25f4b8abe6bcf77fb496451007ed62ff3","receipt_sha256":"230d3b53e7accd5d6d3abd1dab12dc9bc3e30681a4ae7604a752d92e496945fc","repair":"wiki-repair-20261023"},"slug":"drop-trigger","source_rev":"wiki-repair-20261023:ed872a87b2e40024121751398210ec4ff61c28d87c8c2a6336a0614549fe86ba","synopsis":"DROP TRIGGER [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]","verb":"DROP"}},"Definition":{"Collection":"sql","Key":"drop-trigger","SourceDatabase":"center","Version":"18","SourceTable":"sqlcmd","SourceKey":"drop-trigger","SourceRevision":"wiki-repair-20261023:ed872a87b2e40024121751398210ec4ff61c28d87c8c2a6336a0614549fe86ba","Facts":{"anchor":"SQL-DROPTRIGGER","description_zh":"移除一个触发器","description_zh_html":"\u003cpre\u003eDROP TRIGGER [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]\u003c/pre\u003e\u003csection\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\n\u003ccode class=\"command\"\u003eDROP TRIGGER\u003c/code\u003e 移除一个现有触发器的定义。要执行此命令，当前用户必须是定义该触发器的表的所有者。\n  \u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e参数\u003c/h2\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      如果该触发器不存在，则不要抛出错误。这种情况下会发出一个提示。\n     \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      要移除的触发器的名称。\n     \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      定义该触发器的表的名称（可以是模式限定的）。\n     \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      自动删除依赖于该触发器的对象，以及进一步依赖于这些对象的所有对象（参见\u003ca class=\"xref\" href=\"/zh/docs/18/ddl-depend.html\" title=\"5.15. 依赖跟踪\"\u003e第 5.15 节\u003c/a\u003e）。\n     \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      如果有任何对象依赖于该触发器，则拒绝删除它。这是默认值。\n     \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e示例\u003c/h2\u003e\u003cp\u003e\n   删除表 \u003ccode class=\"literal\"\u003efilms\u003c/code\u003e 上的触发器 \u003ccode class=\"literal\"\u003eif_dist_exists\u003c/code\u003e：\n\n\u003c/p\u003e\u003cpre class=\"programlisting\"\u003e\nDROP TRIGGER if_dist_exists ON films;\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e兼容性\u003c/h2\u003e\u003cp\u003e\n\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 中的 \u003ccode class=\"command\"\u003eDROP TRIGGER\u003c/code\u003e 语句与 SQL 标准不兼容。在 SQL 标准中，触发器名称不是表局部的，因此该命令仅为\n   \u003ccode class=\"literal\"\u003eDROP TRIGGER \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e。\n  \u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e另见\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/zh/docs/18/sql-createtrigger.html\" title=\"CREATE TRIGGER\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE TRIGGER\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","file":"sql-droptrigger.html","lang":"en","name":"DROP TRIGGER","purpose":"remove a trigger","purpose_zh":"移除一个触发器","related":["create-trigger"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eDROP TRIGGER\u003c/code\u003e removes an existing trigger definition. To execute this command, the current user must be the owner of the table for which the trigger is defined.\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eDo not throw an error if the trigger does not exist. A notice is issued in this case.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the trigger to remove.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name (optionally schema-qualified) of the table for which the trigger is defined.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eAutomatically drop objects that depend on the trigger, and in turn all objects that depend on those objects (see \u003ca href=\"/docs/18/ddl-depend.html\" title=\"5.15. Dependency Tracking\"\u003eSection 5.15\u003c/a\u003e).\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eRefuse to drop the trigger if any objects depend on it. This is the default.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003eDestroy the trigger \u003ccode class=\"literal\"\u003eif_dist_exists\u003c/code\u003e on the table \u003ccode class=\"literal\"\u003efilms\u003c/code\u003e:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eDROP TRIGGER if_dist_exists ON films;\n\u003c/pre\u003e","key":"examples","title":"Examples"},{"html":"\u003cp\u003eThe \u003ccode class=\"command\"\u003eDROP TRIGGER\u003c/code\u003e statement in \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e is incompatible with the SQL standard. In the SQL standard, trigger names are not local to tables, so the command is simply \u003ccode class=\"literal\"\u003eDROP TRIGGER \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/create-trigger/?v=18\" title=\"CREATE TRIGGER\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE TRIGGER\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","slug":"18","synopsis_html":"DROP TRIGGER [ IF EXISTS ] \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e ON \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_name\u003c/code\u003e\u003c/em\u003e [ CASCADE | RESTRICT ]","synopsis_text":"DROP TRIGGER [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/sql-droptrigger.html","sha256":"e44af52dc0a4c08e8b48aa150d0c155e9c8492447fc9ee104706745c4b9e550e"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-pgdoc"},"ManualEvidence":{},"MeasuredEvidence":{}},"Text":{"Collection":"sql","Key":"drop-trigger","SourceDatabase":"center","Version":"18","Locale":"en","Title":"DROP TRIGGER","Summary":"remove a trigger","BodyHTML":"\u003cpre\u003eDROP TRIGGER [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]\u003c/pre\u003e\u003csection\u003e\u003ch2\u003eDescription\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eDROP TRIGGER\u003c/code\u003e removes an existing trigger definition. To execute this command, the current user must be the owner of the table for which the trigger is defined.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eParameters\u003c/h2\u003e\u003cdiv\u003e\u003cdl\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eDo not throw an error if the trigger does not exist. A notice is issued in this case.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the trigger to remove.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003etable_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name (optionally schema-qualified) of the table for which the trigger is defined.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eCASCADE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eAutomatically drop objects that depend on the trigger, and in turn all objects that depend on those objects (see \u003ca href=\"/docs/18/ddl-depend.html\" rel=\"nofollow\"\u003eSection 5.15\u003c/a\u003e).\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003ccode\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eRefuse to drop the trigger if any objects depend on it. This is the default.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eExamples\u003c/h2\u003e\u003cp\u003eDestroy the trigger \u003ccode\u003eif_dist_exists\u003c/code\u003e on the table \u003ccode\u003efilms\u003c/code\u003e:\u003c/p\u003e\u003cpre\u003eDROP TRIGGER if_dist_exists ON films;\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eCompatibility\u003c/h2\u003e\u003cp\u003eThe \u003ccode\u003eDROP TRIGGER\u003c/code\u003e statement in \u003cspan\u003ePostgreSQL\u003c/span\u003e is incompatible with the SQL standard. In the SQL standard, trigger names are not local to tables, so the command is simply \u003ccode\u003eDROP TRIGGER \u003cem\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/wiki/sql/create-trigger/?v=18\" title=\"CREATE TRIGGER\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE TRIGGER\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","SourceRevision":"wiki-repair-20261023:ed872a87b2e40024121751398210ec4ff61c28d87c8c2a6336a0614549fe86ba","ContentHash":"481b0c9c92d0ef9e178170f7b3fb244f401bf4a2acb2faf36bbe8005456b9570","Payload":{"related":["create-trigger"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eDROP TRIGGER\u003c/code\u003e removes an existing trigger definition. To execute this command, the current user must be the owner of the table for which the trigger is defined.\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eIF EXISTS\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eDo not throw an error if the trigger does not exist. A notice is issued in this case.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the trigger to remove.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name (optionally schema-qualified) of the table for which the trigger is defined.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eCASCADE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eAutomatically drop objects that depend on the trigger, and in turn all objects that depend on those objects (see \u003ca href=\"/docs/18/ddl-depend.html\" title=\"5.15. Dependency Tracking\"\u003eSection 5.15\u003c/a\u003e).\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"literal\"\u003eRESTRICT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eRefuse to drop the trigger if any objects depend on it. This is the default.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003eDestroy the trigger \u003ccode class=\"literal\"\u003eif_dist_exists\u003c/code\u003e on the table \u003ccode class=\"literal\"\u003efilms\u003c/code\u003e:\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eDROP TRIGGER if_dist_exists ON films;\n\u003c/pre\u003e","key":"examples","title":"Examples"},{"html":"\u003cp\u003eThe \u003ccode class=\"command\"\u003eDROP TRIGGER\u003c/code\u003e statement in \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e is incompatible with the SQL standard. In the SQL standard, trigger names are not local to tables, so the command is simply \u003ccode class=\"literal\"\u003eDROP TRIGGER \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/create-trigger/?v=18\" title=\"CREATE TRIGGER\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE TRIGGER\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","synopsis_html":"DROP TRIGGER [ IF EXISTS ] \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e ON \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable_name\u003c/code\u003e\u003c/em\u003e [ CASCADE | RESTRICT ]","synopsis_text":"DROP TRIGGER [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]"}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","6.4","6.5","7.0","7.1","7.2","7.3","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}
