Commit 2fc2d805 authored by Bruce Momjian's avatar Bruce Momjian

doc: clarify how dropping of extensions affects dependent objs.

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
parent 0d8db8cf
...@@ -160,8 +160,10 @@ ALTER FUNCTION <replaceable>name</replaceable> [ ( [ [ <replaceable class="param ...@@ -160,8 +160,10 @@ ALTER FUNCTION <replaceable>name</replaceable> [ ( [ [ <replaceable class="param
<para> <para>
This form marks the function as dependent on the extension, or no longer This form marks the function as dependent on the extension, or no longer
dependent on that extension if <literal>NO</literal> is specified. dependent on that extension if <literal>NO</literal> is specified.
A function that's marked as dependent on an extension is automatically A function that's marked as dependent on an extension is dropped when the
dropped when the extension is dropped. 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> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
...@@ -147,7 +147,12 @@ ALTER PROCEDURE <replaceable>name</replaceable> [ ( [ [ <replaceable class="para ...@@ -147,7 +147,12 @@ ALTER PROCEDURE <replaceable>name</replaceable> [ ( [ [ <replaceable class="para
<term><replaceable class="parameter">extension_name</replaceable></term> <term><replaceable class="parameter">extension_name</replaceable></term>
<listitem> <listitem>
<para> <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> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
...@@ -30,7 +30,9 @@ DROP EXTENSION [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [ ...@@ -30,7 +30,9 @@ DROP EXTENSION [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [
<para> <para>
<command>DROP EXTENSION</command> removes extensions from the database. <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>
<para> <para>
...@@ -77,9 +79,9 @@ DROP EXTENSION [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [ ...@@ -77,9 +79,9 @@ DROP EXTENSION [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [
<term><literal>RESTRICT</literal></term> <term><literal>RESTRICT</literal></term>
<listitem> <listitem>
<para> <para>
Refuse to drop the extension if any objects depend on it (other than This option prevents the specified extensions from being dropped
its own member objects and other extensions listed in the same if there exists non-extension-member objects that depends on any
<command>DROP</command> command). This is the default. the extensions. This is the default.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment