DROP TRIGGER
remove a trigger
English manual coverage begins with PostgreSQL 6.4. Source history and runtime observations have their own recorded version boundaries.
Reading PG 18·Select a recorded version
- anchor
- SQL-DROPTRIGGER
- file
- sql-droptrigger.html
- lang
- en
- name
- DROP TRIGGER
- purpose
- remove a trigger
- purpose zh
- 移除一个触发器
- sections same as
- Unknown
- slug
- 18
- synopsis html
- DROP TRIGGER [ IF EXISTS ] <em class="replaceable"><code>name</code></em> ON <em class="replaceable"><code>table_name</code></em> [ CASCADE | RESTRICT ]
- synopsis text
- DROP TRIGGER [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]
Syntax
DROP TRIGGER [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]Syntax diagrams
Read left to right. Branches are choices, bypasses are optional, loops repeat. Select an underlined parameter to open its rule.
Definition PG 18
DROP TRIGGER [ IF EXISTS ] name ON table_name [ CASCADE | RESTRICT ]
Description
DROP TRIGGER 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.
Parameters
IF EXISTSDo not throw an error if the trigger does not exist. A notice is issued in this case.
nameThe name of the trigger to remove.
table_nameThe name (optionally schema-qualified) of the table for which the trigger is defined.
CASCADEAutomatically drop objects that depend on the trigger, and in turn all objects that depend on those objects (see Section 5.15).
RESTRICTRefuse to drop the trigger if any objects depend on it. This is the default.
Examples
Destroy the trigger if_dist_exists on the table films:
DROP TRIGGER if_dist_exists ON films;
Compatibility
The DROP TRIGGER statement in PostgreSQL is incompatible with the SQL standard. In the SQL standard, trigger names are not local to tables, so the command is simply DROP TRIGGER .name
See Also
CREATE TRIGGERCompare versions
Source references
Full definition and evidence JSON
Definition sources
center · PostgreSQL 18 · wiki-repair-20261023:ed872a87b2e40024121751398210ec4ff61c28d87c8c2a6336a0614549fe86ba
Text language: en · wiki-repair-20261023:ed872a87b2e40024121751398210ec4ff61c28d87c8c2a6336a0614549fe86ba