The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / ref / drop_trigger.sgml
blobd77cc3442486dc23e0485593b4996acad8f91723
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-DROPTRIGGER">
7 <refmeta>
8 <refentrytitle id="SQL-DROPTRIGGER-TITLE">DROP TRIGGER</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>DROP TRIGGER</refname>
15 <refpurpose>remove a trigger</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-droptrigger">
19 <primary>DROP TRIGGER</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 DROP TRIGGER [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> ON <replaceable class="PARAMETER">table</replaceable> [ CASCADE | RESTRICT ]
25 </synopsis>
26 </refsynopsisdiv>
28 <refsect1>
29 <title>Description</title>
31 <para>
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.
35 </para>
36 </refsect1>
38 <refsect1>
39 <title>Parameters</title>
41 <variablelist>
43 <varlistentry>
44 <term><literal>IF EXISTS</literal></term>
45 <listitem>
46 <para>
47 Do not throw an error if the trigger does not exist. A notice is issued
48 in this case.
49 </para>
50 </listitem>
51 </varlistentry>
53 <varlistentry>
54 <term><replaceable class="PARAMETER">name</replaceable></term>
55 <listitem>
56 <para>
57 The name of the trigger to remove.
58 </para>
59 </listitem>
60 </varlistentry>
62 <varlistentry>
63 <term><replaceable class="PARAMETER">table</replaceable></term>
64 <listitem>
65 <para>
66 The name (optionally schema-qualified) of the table for which
67 the trigger is defined.
68 </para>
69 </listitem>
70 </varlistentry>
72 <varlistentry>
73 <term><literal>CASCADE</literal></term>
74 <listitem>
75 <para>
76 Automatically drop objects that depend on the trigger.
77 </para>
78 </listitem>
79 </varlistentry>
81 <varlistentry>
82 <term><literal>RESTRICT</literal></term>
83 <listitem>
84 <para>
85 Refuse to drop the trigger if any objects depend on it. This is
86 the default.
87 </para>
88 </listitem>
89 </varlistentry>
90 </variablelist>
91 </refsect1>
93 <refsect1 id="SQL-DROPTRIGGER-examples">
94 <title>Examples</title>
96 <para>
97 Destroy the trigger <literal>if_dist_exists</literal> on the table
98 <literal>films</literal>:
100 <programlisting>
101 DROP TRIGGER if_dist_exists ON films;
102 </programlisting>
103 </para>
104 </refsect1>
106 <refsect1 id="SQL-DROPTRIGGER-compatibility">
107 <title>Compatibility</title>
109 <para>
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>.
115 </para>
116 </refsect1>
118 <refsect1>
119 <title>See Also</title>
121 <simplelist type="inline">
122 <member><xref linkend="sql-createtrigger" endterm="sql-createtrigger-title"></member>
123 </simplelist>
124 </refsect1>
126 </refentry>