The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / ref / drop_rule.sgml
blob3e60e612a7a93e5d4eeaa406e49db65547c9034f
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-DROPRULE">
7 <refmeta>
8 <refentrytitle id="SQL-DROPRULE-TITLE">DROP RULE</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>DROP RULE</refname>
15 <refpurpose>remove a rewrite rule</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-droprule">
19 <primary>DROP RULE</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 DROP RULE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> ON <replaceable class="PARAMETER">relation</replaceable> [ CASCADE | RESTRICT ]
25 </synopsis>
26 </refsynopsisdiv>
28 <refsect1>
29 <title>Description</title>
31 <para>
32 <command>DROP RULE</command> drops a rewrite rule.
33 </para>
34 </refsect1>
36 <refsect1>
37 <title>Parameters</title>
39 <variablelist>
41 <varlistentry>
42 <term><literal>IF EXISTS</literal></term>
43 <listitem>
44 <para>
45 Do not throw an error if the rule does not exist. A notice is issued
46 in this case.
47 </para>
48 </listitem>
49 </varlistentry>
51 <varlistentry>
52 <term><replaceable class="parameter">name</replaceable></term>
53 <listitem>
54 <para>
55 The name of the rule to drop.
56 </para>
57 </listitem>
58 </varlistentry>
60 <varlistentry>
61 <term><replaceable class="parameter">relation</replaceable></term>
62 <listitem>
63 <para>
64 The name (optionally schema-qualified) of the table or view that
65 the rule applies to.
66 </para>
67 </listitem>
68 </varlistentry>
70 <varlistentry>
71 <term><literal>CASCADE</literal></term>
72 <listitem>
73 <para>
74 Automatically drop objects that depend on the rule.
75 </para>
76 </listitem>
77 </varlistentry>
79 <varlistentry>
80 <term><literal>RESTRICT</literal></term>
81 <listitem>
82 <para>
83 Refuse to drop the rule if any objects depend on it. This is
84 the default.
85 </para>
86 </listitem>
87 </varlistentry>
88 </variablelist>
89 </refsect1>
91 <refsect1>
92 <title>Examples</title>
94 <para>
95 To drop the rewrite rule <literal>newrule</literal>:
97 <programlisting>
98 DROP RULE newrule ON mytable;
99 </programlisting>
100 </para>
101 </refsect1>
103 <refsect1>
104 <title>Compatibility</title>
106 <para>
107 There is no <command>DROP RULE</command> statement in the SQL standard.
108 </para>
109 </refsect1>
111 <refsect1>
112 <title>See Also</title>
114 <simplelist type="inline">
115 <member><xref linkend="sql-createrule" endterm="sql-createrule-title"></member>
116 </simplelist>
117 </refsect1>
119 </refentry>