3 PostgreSQL documentation
6 <refentry id=
"SQL-DROPTRIGGER">
8 <refentrytitle id=
"SQL-DROPTRIGGER-TITLE">DROP TRIGGER
</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
14 <refname>DROP TRIGGER
</refname>
15 <refpurpose>remove a trigger
</refpurpose>
18 <indexterm zone=
"sql-droptrigger">
19 <primary>DROP TRIGGER
</primary>
24 DROP TRIGGER [ IF EXISTS ]
<replaceable class=
"PARAMETER">name
</replaceable> ON
<replaceable class=
"PARAMETER">table
</replaceable> [ CASCADE | RESTRICT ]
29 <title>Description
</title>
32 <command>DROP TRIGGER
</command> removes an existing
33 trigger definition. To execute this command, the current
34 user must be the owner of the table for which the trigger is defined.
39 <title>Parameters
</title>
44 <term><literal>IF EXISTS
</literal></term>
47 Do not throw an error if the trigger does not exist. A notice is issued
54 <term><replaceable class=
"PARAMETER">name
</replaceable></term>
57 The name of the trigger to remove.
63 <term><replaceable class=
"PARAMETER">table
</replaceable></term>
66 The name (optionally schema-qualified) of the table for which
67 the trigger is defined.
73 <term><literal>CASCADE
</literal></term>
76 Automatically drop objects that depend on the trigger.
82 <term><literal>RESTRICT
</literal></term>
85 Refuse to drop the trigger if any objects depend on it. This is
93 <refsect1 id=
"SQL-DROPTRIGGER-examples">
94 <title>Examples
</title>
97 Destroy the trigger
<literal>if_dist_exists
</literal> on the table
98 <literal>films
</literal>:
101 DROP TRIGGER if_dist_exists ON films;
106 <refsect1 id=
"SQL-DROPTRIGGER-compatibility">
107 <title>Compatibility
</title>
110 The
<command>DROP TRIGGER
</command> statement in
111 <productname>PostgreSQL
</productname> is incompatible with the SQL
112 standard. In the SQL standard, trigger names are not local to
113 tables, so the command is simply
<literal>DROP TRIGGER
114 <replaceable>name
</replaceable></literal>.
119 <title>See Also
</title>
121 <simplelist type=
"inline">
122 <member><xref linkend=
"sql-createtrigger" endterm=
"sql-createtrigger-title"></member>