postgresql/doc/src/sgml/ref/drop_rule.sgml

120 lines
2.4 KiB
Plaintext
Raw Normal View History

<!--
2010-09-20 22:08:53 +02:00
doc/src/sgml/ref/drop_rule.sgml
PostgreSQL documentation
-->
<refentry id="SQL-DROPRULE">
<refmeta>
<refentrytitle>DROP RULE</refentrytitle>
<manvolnum>7</manvolnum>
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>
2003-05-04 04:23:16 +02:00
<refnamediv>
2003-05-04 04:23:16 +02:00
<refname>DROP RULE</refname>
<refpurpose>remove a rewrite rule</refpurpose>
</refnamediv>
2003-05-04 04:23:16 +02:00
2003-08-31 19:32:24 +02:00
<indexterm zone="sql-droprule">
<primary>DROP RULE</primary>
</indexterm>
<refsynopsisdiv>
2003-05-04 04:23:16 +02:00
<synopsis>
DROP RULE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> ON <replaceable class="PARAMETER">table</replaceable> [ CASCADE | RESTRICT ]
2003-05-04 04:23:16 +02:00
</synopsis>
</refsynopsisdiv>
2003-05-04 04:23:16 +02:00
<refsect1>
<title>Description</title>
<para>
2003-05-04 04:23:16 +02:00
<command>DROP RULE</command> drops a rewrite rule.
</para>
2003-05-04 04:23:16 +02:00
</refsect1>
<refsect1>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><literal>IF EXISTS</literal></term>
<listitem>
<para>
Do not throw an error if the rule 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 rule to drop.
</para>
</listitem>
</varlistentry>
2003-05-04 04:23:16 +02:00
<varlistentry>
<term><replaceable class="parameter">table</replaceable></term>
2003-05-04 04:23:16 +02:00
<listitem>
<para>
The name (optionally schema-qualified) of the table or view that
the rule applies to.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>CASCADE</literal></term>
<listitem>
<para>
Automatically drop objects that depend on the rule.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>RESTRICT</literal></term>
<listitem>
<para>
Refuse to drop the rule if any objects depend on it. This is
the default.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
2003-05-04 04:23:16 +02:00
<refsect1>
<title>Examples</title>
<para>
To drop the rewrite rule <literal>newrule</literal>:
2003-05-04 04:23:16 +02:00
<programlisting>
DROP RULE newrule ON mytable;
2003-05-04 04:23:16 +02:00
</programlisting>
</para>
</refsect1>
2003-05-04 04:23:16 +02:00
<refsect1>
<title>Compatibility</title>
<para>
There is no <command>DROP RULE</command> statement in the SQL standard.
</para>
</refsect1>
2003-05-04 04:23:16 +02:00
<refsect1>
<title>See Also</title>
<simplelist type="inline">
<member><xref linkend="sql-createrule"></member>
2003-05-04 04:23:16 +02:00
</simplelist>
</refsect1>
</refentry>