mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Doc: clarify that DROP ... CASCADE is recursive.
Apparently that's not obvious to everybody, so let's belabor the point. In passing, document that DROP POLICY has CASCADE/RESTRICT options (which it does, per gram.y) but they do nothing (I assume, anyway). Also update some long-obsolete commentary in gram.y. Discussion: <20160805104837.1412.84915@wrigleys.postgresql.org>
This commit is contained in:
@ -2611,7 +2611,7 @@ VALUES ('Albany', NULL, NULL, 'NY');
|
|||||||
if they are inherited
|
if they are inherited
|
||||||
from any parent tables. If you wish to remove a table and all of its
|
from any parent tables. If you wish to remove a table and all of its
|
||||||
descendants, one easy way is to drop the parent table with the
|
descendants, one easy way is to drop the parent table with the
|
||||||
<literal>CASCADE</literal> option.
|
<literal>CASCADE</literal> option (see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -3586,20 +3586,22 @@ HINT: Use DROP ... CASCADE to drop the dependent objects too.
|
|||||||
<screen>
|
<screen>
|
||||||
DROP TABLE products CASCADE;
|
DROP TABLE products CASCADE;
|
||||||
</screen>
|
</screen>
|
||||||
and all the dependent objects will be removed. In this case, it
|
and all the dependent objects will be removed, as will any objects
|
||||||
doesn't remove the orders table, it only removes the foreign key
|
that depend on them, recursively. In this case, it doesn't remove
|
||||||
constraint. (If you want to check what <command>DROP ... CASCADE</> will do,
|
the orders table, it only removes the foreign key constraint.
|
||||||
|
It stops there because nothing depends on the foreign key constraint.
|
||||||
|
(If you want to check what <command>DROP ... CASCADE</> will do,
|
||||||
run <command>DROP</> without <literal>CASCADE</> and read the
|
run <command>DROP</> without <literal>CASCADE</> and read the
|
||||||
<literal>DETAIL</> output.)
|
<literal>DETAIL</> output.)
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
All <command>DROP</> commands in <productname>PostgreSQL</> support
|
Almost all <command>DROP</> commands in <productname>PostgreSQL</> support
|
||||||
specifying <literal>CASCADE</literal>. Of course, the nature of
|
specifying <literal>CASCADE</literal>. Of course, the nature of
|
||||||
the possible dependencies varies with the type of the object. You
|
the possible dependencies varies with the type of the object. You
|
||||||
can also write <literal>RESTRICT</literal> instead of
|
can also write <literal>RESTRICT</literal> instead of
|
||||||
<literal>CASCADE</literal> to get the default behavior, which is to
|
<literal>CASCADE</literal> to get the default behavior, which is to
|
||||||
prevent the dropping of objects that other objects depend on.
|
prevent dropping objects that any other objects depend on.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
@ -3613,6 +3615,15 @@ DROP TABLE products CASCADE;
|
|||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
If a <command>DROP</> command lists multiple
|
||||||
|
objects, <literal>CASCADE</literal> is only required when there are
|
||||||
|
dependencies outside the specified group. For example, when saying
|
||||||
|
<literal>DROP TABLE tab1, tab2</literal> the existence of a foreign
|
||||||
|
key referencing <literal>tab1</> from <literal>tab2</> would not mean
|
||||||
|
that <literal>CASCADE</literal> is needed to succeed.
|
||||||
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
For user-defined functions, <productname>PostgreSQL</productname> tracks
|
For user-defined functions, <productname>PostgreSQL</productname> tracks
|
||||||
dependencies associated with a function's externally-visible properties,
|
dependencies associated with a function's externally-visible properties,
|
||||||
|
@ -212,7 +212,9 @@ ALTER DOMAIN <replaceable class="PARAMETER">name</replaceable>
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the constraint.
|
Automatically drop objects that depend on the constraint,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -431,7 +431,9 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceab
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the dropped column
|
Automatically drop objects that depend on the dropped column
|
||||||
or constraint (for example, views referencing the column).
|
or constraint (for example, views referencing the column),
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -823,7 +823,9 @@ ALTER TABLE ALL IN TABLESPACE <replaceable class="PARAMETER">name</replaceable>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the dropped column
|
Automatically drop objects that depend on the dropped column
|
||||||
or constraint (for example, views referencing the column).
|
or constraint (for example, views referencing the column),
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -62,7 +62,9 @@ DROP ACCESS METHOD [ IF EXISTS ] <replaceable class="parameter">name</replaceabl
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the access method
|
Automatically drop objects that depend on the access method
|
||||||
(such as operator classes, operator families, indexes).
|
(such as operator classes, operator families, and indexes),
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -107,7 +107,10 @@ DROP AGGREGATE [ IF EXISTS ] <replaceable>name</replaceable> ( <replaceable>aggr
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the aggregate function.
|
Automatically drop objects that depend on the aggregate function
|
||||||
|
(such as views using it),
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -60,7 +60,9 @@ DROP COLLATION [ IF EXISTS ] <replaceable>name</replaceable> [ CASCADE | RESTRIC
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the collation.
|
Automatically drop objects that depend on the collation,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -62,7 +62,9 @@ DROP DOMAIN [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, .
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the domain (such as
|
Automatically drop objects that depend on the domain (such as
|
||||||
table columns).
|
table columns),
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -63,7 +63,9 @@ DROP EVENT TRIGGER [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceabl
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the trigger.
|
Automatically drop objects that depend on the trigger,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -66,7 +66,9 @@ DROP EXTENSION [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the extension.
|
Automatically drop objects that depend on the extension,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -63,7 +63,9 @@ DROP FOREIGN DATA WRAPPER [ IF EXISTS ] <replaceable class="parameter">name</rep
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the foreign-data
|
Automatically drop objects that depend on the foreign-data
|
||||||
wrapper (such as servers).
|
wrapper (such as foreign tables and servers),
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -72,7 +74,7 @@ DROP FOREIGN DATA WRAPPER [ IF EXISTS ] <replaceable class="parameter">name</rep
|
|||||||
<term><literal>RESTRICT</literal></term>
|
<term><literal>RESTRICT</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Refuse to drop the foreign-data wrappers if any objects depend
|
Refuse to drop the foreign-data wrapper if any objects depend
|
||||||
on it. This is the default.
|
on it. This is the default.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
@ -59,7 +59,8 @@ DROP FOREIGN TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceabl
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the foreign table (such as
|
Automatically drop objects that depend on the foreign table (such as
|
||||||
views).
|
views), and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -107,7 +107,9 @@ DROP FUNCTION [ IF EXISTS ] <replaceable class="parameter">name</replaceable> (
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the function (such as
|
Automatically drop objects that depend on the function (such as
|
||||||
operators or triggers).
|
operators or triggers),
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -84,7 +84,9 @@ DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] <replaceable class="PARAMETER">name</r
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the index.
|
Automatically drop objects that depend on the index,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -74,7 +74,9 @@ DROP [ PROCEDURAL ] LANGUAGE [ IF EXISTS ] <replaceable class="PARAMETER">name</
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the language (such as
|
Automatically drop objects that depend on the language (such as
|
||||||
functions in the language).
|
functions in the language),
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -64,7 +64,9 @@ DROP MATERIALIZED VIEW [ IF EXISTS ] <replaceable class="PARAMETER">name</replac
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the materialized view (such as
|
Automatically drop objects that depend on the materialized view (such as
|
||||||
other materialized views, or regular views).
|
other materialized views, or regular views),
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -78,7 +78,9 @@ DROP OPERATOR CLASS [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceab
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the operator class.
|
Automatically drop objects that depend on the operator class (such as
|
||||||
|
indexes), and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -83,7 +83,9 @@ DROP OPERATOR [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> (
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the operator.
|
Automatically drop objects that depend on the operator (such as views
|
||||||
|
using it), and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -79,7 +79,9 @@ DROP OPERATOR FAMILY [ IF EXISTS ] <replaceable class="PARAMETER">name</replacea
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the operator family.
|
Automatically drop objects that depend on the operator family,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -55,7 +55,9 @@ DROP OWNED BY { <replaceable class="PARAMETER">name</replaceable> | CURRENT_USER
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the affected objects.
|
Automatically drop objects that depend on the affected objects,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -21,7 +21,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<synopsis>
|
<synopsis>
|
||||||
DROP POLICY [ IF EXISTS ] <replaceable class="parameter">name</replaceable> ON <replaceable class="parameter">table_name</replaceable>
|
DROP POLICY [ IF EXISTS ] <replaceable class="parameter">name</replaceable> ON <replaceable class="parameter">table_name</replaceable> [ CASCADE | RESTRICT ]
|
||||||
</synopsis>
|
</synopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@ -72,6 +72,18 @@ DROP POLICY [ IF EXISTS ] <replaceable class="parameter">name</replaceable> ON <
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>CASCADE</literal></term>
|
||||||
|
<term><literal>RESTRICT</literal></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
These key words do not have any effect, since there are no
|
||||||
|
dependencies on policies.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -71,7 +71,9 @@ DROP RULE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> ON <re
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the rule.
|
Automatically drop objects that depend on the rule,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -67,7 +67,9 @@ DROP SCHEMA [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, .
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects (tables, functions, etc.) that are
|
Automatically drop objects (tables, functions, etc.) that are
|
||||||
contained in the schema.
|
contained in the schema,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -84,6 +86,15 @@ DROP SCHEMA [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, .
|
|||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1>
|
||||||
|
<title>Notes</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Using the <literal>CASCADE</literal> option might make the command
|
||||||
|
remove objects in other schemas besides the one(s) named.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Examples</title>
|
<title>Examples</title>
|
||||||
|
|
||||||
|
@ -61,7 +61,9 @@ DROP SEQUENCE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [,
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the sequence.
|
Automatically drop objects that depend on the sequence,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -63,7 +63,9 @@ DROP SERVER [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [ CA
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the server (such as
|
Automatically drop objects that depend on the server (such as
|
||||||
user mappings).
|
user mappings),
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -75,7 +75,9 @@ DROP TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ..
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the table (such as
|
Automatically drop objects that depend on the table (such as
|
||||||
views).
|
views),
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<synopsis>
|
<synopsis>
|
||||||
DROP TRANSFORM [ IF EXISTS ] FOR <replaceable>type_name</replaceable> LANGUAGE <replaceable>lang_name</replaceable>
|
DROP TRANSFORM [ IF EXISTS ] FOR <replaceable>type_name</replaceable> LANGUAGE <replaceable>lang_name</replaceable> [ CASCADE | RESTRICT ]
|
||||||
</synopsis>
|
</synopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@ -74,7 +74,9 @@ DROP TRANSFORM [ IF EXISTS ] FOR <replaceable>type_name</replaceable> LANGUAGE <
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the transform.
|
Automatically drop objects that depend on the transform,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -73,7 +73,9 @@ DROP TRIGGER [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> ON
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the trigger.
|
Automatically drop objects that depend on the trigger,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -64,7 +64,9 @@ DROP TEXT SEARCH CONFIGURATION [ IF EXISTS ] <replaceable class="PARAMETER">name
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the text search configuration.
|
Automatically drop objects that depend on the text search configuration,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -64,7 +64,9 @@ DROP TEXT SEARCH DICTIONARY [ IF EXISTS ] <replaceable class="PARAMETER">name</r
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the text search dictionary.
|
Automatically drop objects that depend on the text search dictionary,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -62,7 +62,9 @@ DROP TEXT SEARCH PARSER [ IF EXISTS ] <replaceable class="PARAMETER">name</repla
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the text search parser.
|
Automatically drop objects that depend on the text search parser,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -63,7 +63,9 @@ DROP TEXT SEARCH TEMPLATE [ IF EXISTS ] <replaceable class="PARAMETER">name</rep
|
|||||||
<term><literal>CASCADE</literal></term>
|
<term><literal>CASCADE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the text search template.
|
Automatically drop objects that depend on the text search template,
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -62,7 +62,9 @@ DROP TYPE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the type (such as
|
Automatically drop objects that depend on the type (such as
|
||||||
table columns, functions, operators).
|
table columns, functions, and operators),
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -62,7 +62,9 @@ DROP VIEW [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Automatically drop objects that depend on the view (such as
|
Automatically drop objects that depend on the view (such as
|
||||||
other views).
|
other views),
|
||||||
|
and in turn all objects that depend on those objects
|
||||||
|
(see <xref linkend="ddl-depend">).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -1126,9 +1126,9 @@ AlterUserSetStmt:
|
|||||||
*
|
*
|
||||||
* Drop a postgresql DBMS role
|
* Drop a postgresql DBMS role
|
||||||
*
|
*
|
||||||
* XXX Ideally this would have CASCADE/RESTRICT options, but since a role
|
* XXX Ideally this would have CASCADE/RESTRICT options, but a role
|
||||||
* might own objects in multiple databases, there is presently no way to
|
* might own objects in multiple databases, and there is presently no way to
|
||||||
* implement either cascading or restricting. Caveat DBA.
|
* implement cascading to other databases. So we always behave as RESTRICT.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
DropRoleStmt:
|
DropRoleStmt:
|
||||||
@ -1152,9 +1152,7 @@ DropRoleStmt:
|
|||||||
*
|
*
|
||||||
* Drop a postgresql DBMS user
|
* Drop a postgresql DBMS user
|
||||||
*
|
*
|
||||||
* XXX Ideally this would have CASCADE/RESTRICT options, but since a user
|
* XXX As with DROP ROLE, no CASCADE/RESTRICT here.
|
||||||
* might own objects in multiple databases, there is presently no way to
|
|
||||||
* implement either cascading or restricting. Caveat DBA.
|
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
DropUserStmt:
|
DropUserStmt:
|
||||||
@ -1220,7 +1218,7 @@ add_drop: ADD_P { $$ = +1; }
|
|||||||
*
|
*
|
||||||
* Drop a postgresql group
|
* Drop a postgresql group
|
||||||
*
|
*
|
||||||
* XXX see above notes about cascading DROP USER; groups have same problem.
|
* XXX As with DROP ROLE, no CASCADE/RESTRICT here.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
DropGroupStmt:
|
DropGroupStmt:
|
||||||
@ -4574,6 +4572,8 @@ auth_ident: RoleSpec { $$ = $1; }
|
|||||||
* QUERY :
|
* QUERY :
|
||||||
* DROP USER MAPPING FOR auth_ident SERVER name
|
* DROP USER MAPPING FOR auth_ident SERVER name
|
||||||
*
|
*
|
||||||
|
* XXX you'd think this should have a CASCADE/RESTRICT option, even if it's
|
||||||
|
* only pro forma; but the SQL standard doesn't show one.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
DropUserMappingStmt: DROP USER MAPPING FOR auth_ident SERVER name
|
DropUserMappingStmt: DROP USER MAPPING FOR auth_ident SERVER name
|
||||||
|
Reference in New Issue
Block a user