1999-07-22 17:09:15 +02:00
|
|
|
<!--
|
2006-09-16 02:30:20 +02:00
|
|
|
$PostgreSQL: pgsql/doc/src/sgml/ref/drop_trigger.sgml,v 1.21 2006/09/16 00:30:18 momjian Exp $
|
2001-12-08 04:24:40 +01:00
|
|
|
PostgreSQL documentation
|
1999-07-22 17:09:15 +02:00
|
|
|
-->
|
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
<refentry id="SQL-DROPTRIGGER">
|
|
|
|
<refmeta>
|
2002-04-21 21:02:39 +02:00
|
|
|
<refentrytitle id="SQL-DROPTRIGGER-TITLE">DROP TRIGGER</refentrytitle>
|
1999-07-06 19:16:42 +02:00
|
|
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
|
|
|
</refmeta>
|
2003-05-04 04:23:16 +02:00
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
<refnamediv>
|
2003-05-04 04:23:16 +02:00
|
|
|
<refname>DROP TRIGGER</refname>
|
|
|
|
<refpurpose>remove a trigger</refpurpose>
|
1998-12-29 03:24:47 +01:00
|
|
|
</refnamediv>
|
2003-05-04 04:23:16 +02:00
|
|
|
|
2003-08-31 19:32:24 +02:00
|
|
|
<indexterm zone="sql-droptrigger">
|
|
|
|
<primary>DROP TRIGGER</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
<refsynopsisdiv>
|
2003-05-04 04:23:16 +02:00
|
|
|
<synopsis>
|
2006-06-17 00:27:55 +02:00
|
|
|
DROP TRIGGER [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> ON <replaceable class="PARAMETER">table</replaceable> [ CASCADE | RESTRICT ]
|
2003-05-04 04:23:16 +02:00
|
|
|
</synopsis>
|
1999-07-06 19:16:42 +02:00
|
|
|
</refsynopsisdiv>
|
|
|
|
|
2003-05-04 04:23:16 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
<para>
|
2002-04-23 04:07:16 +02:00
|
|
|
<command>DROP TRIGGER</command> will remove an existing
|
2003-05-04 04:23:16 +02:00
|
|
|
trigger definition. To execute this command, the current
|
2001-09-13 20:17:44 +02:00
|
|
|
user must be the owner of the table for which the trigger is defined.
|
1999-07-06 19:16:42 +02:00
|
|
|
</para>
|
1998-12-29 03:24:47 +01:00
|
|
|
</refsect1>
|
2001-09-13 20:17:44 +02:00
|
|
|
|
2003-05-04 04:23:16 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Parameters</title>
|
2001-09-13 20:17:44 +02:00
|
|
|
|
2003-05-04 04:23:16 +02:00
|
|
|
<variablelist>
|
2006-06-17 00:27:55 +02:00
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><literal>IF EXISTS</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Do not throw an error if the trigger does not exist. A notice is issued
|
|
|
|
in this case.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2003-05-04 04:23:16 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="PARAMETER">name</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The name of the trigger to remove.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
1999-07-06 19:16:42 +02:00
|
|
|
|
2003-05-04 04:23:16 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="PARAMETER">table</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2004-09-20 02:04:19 +02:00
|
|
|
The name (optionally schema-qualified) of the table for which
|
|
|
|
the trigger is defined.
|
2003-05-04 04:23:16 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><literal>CASCADE</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Automatically drop objects that depend on the trigger.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><literal>RESTRICT</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Refuse to drop the trigger if any objects depend on it. This is
|
|
|
|
the default.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
1999-07-06 19:16:42 +02:00
|
|
|
</refsect1>
|
2003-05-04 04:23:16 +02:00
|
|
|
|
|
|
|
<refsect1 id="SQL-DROPTRIGGER-examples">
|
|
|
|
<title>Examples</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Destroy the trigger <literal>if_dist_exists</literal> on the table
|
|
|
|
<literal>films</literal>:
|
|
|
|
|
|
|
|
<programlisting>
|
|
|
|
DROP TRIGGER if_dist_exists ON films;
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 id="SQL-DROPTRIGGER-compatibility">
|
|
|
|
<title>Compatibility</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <command>DROP TRIGGER</command> statement in
|
|
|
|
<productname>PostgreSQL</productname> is incompatible with the SQL
|
|
|
|
standard. In the SQL standard, trigger names are not local to
|
|
|
|
tables, so the command is simply <literal>DROP TRIGGER
|
|
|
|
<replaceable>name</replaceable></literal>.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2001-09-13 20:17:44 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>See Also</title>
|
|
|
|
|
|
|
|
<simplelist type="inline">
|
2002-11-22 00:34:43 +01:00
|
|
|
<member><xref linkend="sql-createtrigger" endterm="sql-createtrigger-title"></member>
|
2001-09-13 20:17:44 +02:00
|
|
|
</simplelist>
|
1998-09-07 17:53:12 +02:00
|
|
|
</refsect1>
|
2003-05-04 04:23:16 +02:00
|
|
|
|
1999-07-06 19:16:42 +02:00
|
|
|
</refentry>
|