From 5fc703946bf3b18642ce83b937671d254a8ac5b5 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Mon, 20 Apr 2020 13:42:12 -0400 Subject: Add ALTER .. NO DEPENDS ON Commit f2fcad27d59c (9.6 era) added the ability to mark objects as dependent an extension, but forgot to add a way for such dependencies to be removed. This commit fixes that oversight. Strictly speaking this should be backpatched to 9.6, but due to lack of demand we're not doing so at this time. Discussion: https://postgr.es/m/20200217225333.GA30974@alvherre.pgsql Reviewed-by: ahsan hadi Reviewed-by: Ibrar Ahmed Reviewed-by: Tom Lane --- doc/src/sgml/ref/alter_function.sgml | 10 +++++++--- doc/src/sgml/ref/alter_index.sgml | 9 ++++++--- doc/src/sgml/ref/alter_materialized_view.sgml | 11 ++++------- doc/src/sgml/ref/alter_trigger.sgml | 7 +++++-- 4 files changed, 22 insertions(+), 15 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/alter_function.sgml b/doc/src/sgml/ref/alter_function.sgml index 03ffa5945a2..70b1f24bc00 100644 --- a/doc/src/sgml/ref/alter_function.sgml +++ b/doc/src/sgml/ref/alter_function.sgml @@ -30,7 +30,7 @@ ALTER FUNCTION name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] SET SCHEMA new_schema ALTER FUNCTION name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] - DEPENDS ON EXTENSION extension_name + [ NO ] DEPENDS ON EXTENSION extension_name where action is one of: @@ -153,10 +153,14 @@ ALTER FUNCTION name [ ( [ [ extension_name + DEPENDS ON EXTENSION extension_name + NO DEPENDS ON EXTENSION extension_name - The name of the extension that the function is to depend on. + This form marks the function as dependent on the extension, or no longer + dependent on that extension if NO is specified. + A function that's marked as dependent on an extension is automatically + dropped when the extension is dropped. diff --git a/doc/src/sgml/ref/alter_index.sgml b/doc/src/sgml/ref/alter_index.sgml index 6d34dbb74e5..de6f89d458c 100644 --- a/doc/src/sgml/ref/alter_index.sgml +++ b/doc/src/sgml/ref/alter_index.sgml @@ -100,11 +100,14 @@ ALTER INDEX ALL IN TABLESPACE name - DEPENDS ON EXTENSION + DEPENDS ON EXTENSION extension_name + NO DEPENDS ON EXTENSION extension_name - This form marks the index as dependent on the extension, such that if the - extension is dropped, the index will automatically be dropped as well. + This form marks the index as dependent on the extension, or no longer + dependent on that extension if NO is specified. + An index that's marked as dependent on an extension is automatically + dropped when the extension is dropped. diff --git a/doc/src/sgml/ref/alter_materialized_view.sgml b/doc/src/sgml/ref/alter_materialized_view.sgml index 03e3df1ffdb..9df8a799771 100644 --- a/doc/src/sgml/ref/alter_materialized_view.sgml +++ b/doc/src/sgml/ref/alter_materialized_view.sgml @@ -68,12 +68,6 @@ ALTER MATERIALIZED VIEW ALL IN TABLESPACE name - - The DEPENDS ON EXTENSION form marks the materialized view - as dependent on an extension, such that the materialized view will - automatically be dropped if the extension is dropped. - - The statement subforms and actions available for ALTER MATERIALIZED VIEW are a subset of those available @@ -110,7 +104,10 @@ ALTER MATERIALIZED VIEW ALL IN TABLESPACE nameextension_name - The name of the extension that the materialized view is to depend on. + The name of the extension that the materialized view is to depend on (or no longer + dependent on, if NO is specified). A materialized view + that's marked as dependent on an extension is automatically dropped when + the extension is dropped. diff --git a/doc/src/sgml/ref/alter_trigger.sgml b/doc/src/sgml/ref/alter_trigger.sgml index 6cf789a67a3..6d4784c82f1 100644 --- a/doc/src/sgml/ref/alter_trigger.sgml +++ b/doc/src/sgml/ref/alter_trigger.sgml @@ -22,7 +22,7 @@ PostgreSQL documentation ALTER TRIGGER name ON table_name RENAME TO new_name -ALTER TRIGGER name ON table_name DEPENDS ON EXTENSION extension_name +ALTER TRIGGER name ON table_name [ NO ] DEPENDS ON EXTENSION extension_name @@ -78,7 +78,10 @@ ALTER TRIGGER name ON extension_name - The name of the extension that the trigger is to depend on. + The name of the extension that the trigger is to depend on (or no longer + dependent on, if NO is specified). A trigger + that's marked as dependent on an extension is automatically dropped when + the extension is dropped. -- cgit v1.2.3