On Tue, Jul 5, 2022 at 08:12:09PM -0400, Tom Lane wrote: > "David G. Johnston" <david.g.johns...@gmail.com> writes: > > + A function that's marked as dependent on an extension is dropped when > the > + extension is dropped, even if cascade is not specified. > + dependency checking in restrict mode <xref > linkend="sql-dropextension"/>. > + A function can depend upon multiple extensions, and will be dropped > when > + any one of those extensions is dropped. > > Third line here seems like a copy/paste mistake? Also I'd tend > to mark up the keyword as <literal>CASCADE</literal>. > > + This form marks the procedure as dependent on the extension, or no > longer > + dependent on that extension if <literal>NO</literal> is specified. > > The/that inconsistency ... choose one. Or actually, the "an ... the" > combination you used elsewhere doesn't grate on the ear either. > > + For each extension, refuse to drop anything if any objects (other than > the > + extensions listed) depend on it. However, its own member objects, and > routines > + that are explicitly dependent on this extension, are skipped. > + This is the default. > > "skipped" seems like a horrible choice of word; it could easily be read as > "they don't get dropped". I am not convinced that mentioning the member > objects here is an improvement either. In the first sentence you are > treating each extension as a monolithic object; why not in the second?
I created a modified patch based on this feedback; patch attached. I rewrote the last change. -- Bruce Momjian <br...@momjian.us> https://momjian.us EDB https://enterprisedb.com Indecision is a decision. Inaction is an action. Mark Batterson
diff --git a/doc/src/sgml/ref/alter_function.sgml b/doc/src/sgml/ref/alter_function.sgml index 0ee756a94d..2e8e1162d8 100644 --- a/doc/src/sgml/ref/alter_function.sgml +++ b/doc/src/sgml/ref/alter_function.sgml @@ -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> diff --git a/doc/src/sgml/ref/alter_procedure.sgml b/doc/src/sgml/ref/alter_procedure.sgml index 033fda92ee..20a623885f 100644 --- a/doc/src/sgml/ref/alter_procedure.sgml +++ b/doc/src/sgml/ref/alter_procedure.sgml @@ -147,7 +147,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> diff --git a/doc/src/sgml/ref/drop_extension.sgml b/doc/src/sgml/ref/drop_extension.sgml index 5e507dec92..c01ddace84 100644 --- a/doc/src/sgml/ref/drop_extension.sgml +++ b/doc/src/sgml/ref/drop_extension.sgml @@ -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>