]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/drop_trigger.sgml
Create a "sort support" interface API for faster sorting.
[postgresql] / doc / src / sgml / ref / drop_trigger.sgml
1 <!--
2 doc/src/sgml/ref/drop_trigger.sgml
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-DROPTRIGGER">
7  <refmeta>
8   <refentrytitle>DROP TRIGGER</refentrytitle>
9   <manvolnum>7</manvolnum>
10   <refmiscinfo>SQL - Language Statements</refmiscinfo>
11  </refmeta>
12
13  <refnamediv>
14   <refname>DROP TRIGGER</refname>
15   <refpurpose>remove a trigger</refpurpose>
16  </refnamediv>
17
18  <indexterm zone="sql-droptrigger">
19   <primary>DROP TRIGGER</primary>
20  </indexterm>
21
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>
27
28  <refsect1>
29   <title>Description</title>
30
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>
37
38  <refsect1>
39   <title>Parameters</title>
40
41   <variablelist>
42
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>
52
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>
61
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>
71
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>
80
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>
92
93  <refsect1 id="SQL-DROPTRIGGER-examples">
94   <title>Examples</title>
95
96   <para>
97    Destroy the trigger <literal>if_dist_exists</literal> on the table
98    <literal>films</literal>:
99
100 <programlisting>
101 DROP TRIGGER if_dist_exists ON films;
102 </programlisting></para>
103  </refsect1>
104
105  <refsect1 id="SQL-DROPTRIGGER-compatibility">
106   <title>Compatibility</title>
107
108   <para>
109    The <command>DROP TRIGGER</command> statement in
110    <productname>PostgreSQL</productname> is incompatible with the SQL
111    standard.  In the SQL standard, trigger names are not local to
112    tables, so the command is simply <literal>DROP TRIGGER
113    <replaceable>name</replaceable></literal>.
114   </para>
115  </refsect1>
116
117  <refsect1>
118   <title>See Also</title>
119
120   <simplelist type="inline">
121    <member><xref linkend="sql-createtrigger"></member>
122   </simplelist>
123  </refsect1>
124
125 </refentry>