@@ -2611,7 +2611,7 @@ VALUES ('Albany', NULL, NULL, 'NY');
2611
2611
if they are inherited
2612
2612
from any parent tables. If you wish to remove a table and all of its
2613
2613
descendants, one easy way is to drop the parent table with the
2614
- <literal>CASCADE</literal> option.
2614
+ <literal>CASCADE</literal> option (see <xref linkend="ddl-depend">) .
2615
2615
</para>
2616
2616
2617
2617
<para>
@@ -3586,20 +3586,22 @@ HINT: Use DROP ... CASCADE to drop the dependent objects too.
3586
3586
<screen>
3587
3587
DROP TABLE products CASCADE;
3588
3588
</screen>
3589
- and all the dependent objects will be removed. In this case, it
3590
- doesn't remove the orders table, it only removes the foreign key
3591
- constraint. (If you want to check what <command>DROP ... CASCADE</> will do,
3589
+ and all the dependent objects will be removed, as will any objects
3590
+ that depend on them, recursively. In this case, it doesn't remove
3591
+ the orders table, it only removes the foreign key constraint.
3592
+ It stops there because nothing depends on the foreign key constraint.
3593
+ (If you want to check what <command>DROP ... CASCADE</> will do,
3592
3594
run <command>DROP</> without <literal>CASCADE</> and read the
3593
3595
<literal>DETAIL</> output.)
3594
3596
</para>
3595
3597
3596
3598
<para>
3597
- All <command>DROP</> commands in <productname>PostgreSQL</> support
3599
+ Almost all <command>DROP</> commands in <productname>PostgreSQL</> support
3598
3600
specifying <literal>CASCADE</literal>. Of course, the nature of
3599
3601
the possible dependencies varies with the type of the object. You
3600
3602
can also write <literal>RESTRICT</literal> instead of
3601
3603
<literal>CASCADE</literal> to get the default behavior, which is to
3602
- prevent the dropping of objects that other objects depend on.
3604
+ prevent dropping objects that any other objects depend on.
3603
3605
</para>
3604
3606
3605
3607
<note>
@@ -3613,6 +3615,15 @@ DROP TABLE products CASCADE;
3613
3615
</para>
3614
3616
</note>
3615
3617
3618
+ <para>
3619
+ If a <command>DROP</> command lists multiple
3620
+ objects, <literal>CASCADE</literal> is only required when there are
3621
+ dependencies outside the specified group. For example, when saying
3622
+ <literal>DROP TABLE tab1, tab2</literal> the existence of a foreign
3623
+ key referencing <literal>tab1</> from <literal>tab2</> would not mean
3624
+ that <literal>CASCADE</literal> is needed to succeed.
3625
+ </para>
3626
+
3616
3627
<para>
3617
3628
For user-defined functions, <productname>PostgreSQL</productname> tracks
3618
3629
dependencies associated with a function's externally-visible properties,
0 commit comments