doc: clarify how dropping of extensions affects dependent objs.
authorBruce Momjian <bruce@momjian.us>
Thu, 14 Jul 2022 21:41:03 +0000 (17:41 -0400)
committerBruce Momjian <bruce@momjian.us>
Thu, 14 Jul 2022 21:41:03 +0000 (17:41 -0400)
Clarify that functions/procedures are dropped when any extension that
depends on them is dropped.

Reported-by: David G. Johnston
Discussion: https://postgr.es/m/CAKFQuwbPSHMDGkisRUmewopweC1bFvytVqB=a=X4GFg=4ZWxPA@mail.gmail.com

Backpatch-through: 13

doc/src/sgml/ref/alter_function.sgml
doc/src/sgml/ref/alter_procedure.sgml
doc/src/sgml/ref/drop_extension.sgml

index c5d12af25cdc620f12dcd9099fc830cf4c500ec5..f64940b731936d87039d2fc325b92aa376a60c3b 100644 (file)
@@ -160,8 +160,10 @@ ALTER FUNCTION <replaceable>name</replaceable> [ ( [ [ <replaceable class="param
      <para>
       This form marks the function as dependent on the extension, or no longer
       dependent on that extension if <literal>NO</literal> is specified.
-      A function that's marked as dependent on an extension is automatically
-      dropped when the extension is dropped.
+      A function that's marked as dependent on an extension is dropped when the
+      extension is dropped, even if <literal>CASCADE</literal> is not specified.
+      A function can depend upon multiple extensions, and will be dropped when
+      any one of those extensions is dropped.
      </para>
     </listitem>
    </varlistentry>
index 9148d282168d5d6bc2d62c5386d9d526ef4cd8e0..6afb2d52b7636b84307d9c62b59662f033a4e76a 100644 (file)
@@ -144,7 +144,12 @@ ALTER PROCEDURE <replaceable>name</replaceable> [ ( [ [ <replaceable class="para
     <term><replaceable class="parameter">extension_name</replaceable></term>
     <listitem>
      <para>
-      The name of the extension that the procedure is to depend on.
+      This form marks the procedure as dependent on the extension, or no longer
+      dependent on the extension if <literal>NO</literal> is specified.
+      A procedure that's marked as dependent on an extension is dropped when the
+      extension is dropped, even if cascade is not specified.
+      A procedure can depend upon multiple extensions, and will be dropped when
+      any one of those extensions is dropped.
      </para>
     </listitem>
    </varlistentry>
index 5e507dec92843f11e6c3dd4f01aef5cfcab1e00a..c01ddace84c70793849b5770388422166b3d143a 100644 (file)
@@ -30,7 +30,9 @@ DROP EXTENSION [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [
 
   <para>
    <command>DROP EXTENSION</command> removes extensions from the database.
-   Dropping an extension causes its component objects to be dropped as well.
+   Dropping an extension causes its component objects, and other explicitly
+   dependent routines (see <xref linkend="sql-alterroutine"/>,
+   the depends on extension action), to be dropped as well.
   </para>
 
   <para>
@@ -77,9 +79,9 @@ DROP EXTENSION [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [
     <term><literal>RESTRICT</literal></term>
     <listitem>
      <para>
-      Refuse to drop the extension if any objects depend on it (other than
-      its own member objects and other extensions listed in the same
-      <command>DROP</command> command).  This is the default.
+      This option prevents the specified extensions from being dropped
+      if there exists non-extension-member objects that depends on any
+      the extensions.  This is the default.
      </para>
     </listitem>
    </varlistentry>