~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-updates

« back to all changes in this revision

Viewing changes to doc/src/sgml/ref/drop_trigger.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--
 
2
$PostgreSQL$
 
3
PostgreSQL documentation
 
4
-->
 
5
 
 
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>
 
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>
 
103
  </para>
 
104
 </refsect1>
 
105
 
 
106
 <refsect1 id="SQL-DROPTRIGGER-compatibility">
 
107
  <title>Compatibility</title>
 
108
  
 
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>
 
117
 
 
118
 <refsect1>
 
119
  <title>See Also</title>
 
120
 
 
121
  <simplelist type="inline">
 
122
   <member><xref linkend="sql-createtrigger" endterm="sql-createtrigger-title"></member>
 
123
  </simplelist>
 
124
 </refsect1>
 
125
 
 
126
</refentry>