pgsql: Add @extschema:name@ and no_relocate options to extensions. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Add @extschema:name@ and no_relocate options to extensions.
Date
Msg-id E1peO85-004YBh-Pe@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Add @extschema:name@ and no_relocate options to extensions.

@extschema:name@ extends the existing @extschema@ feature so that
we can also insert the schema name of some required extension,
thus making cross-extension references robust even if they are in
different schemas.

However, this has the same hazard as @extschema@: if the schema
name is embedded literally in an installed object, rather than being
looked up once during extension script execution, then it's no longer
safe to relocate the other extension to another schema.  To deal with
that without restricting things unnecessarily, add a "no_relocate"
option to extension control files.  This allows an extension to
specify that it cannot handle relocation of some of its required
extensions, even if in themselves those extensions are relocatable.
We detect "no_relocate" requests of dependent extensions during
ALTER EXTENSION SET SCHEMA.

Regina Obe, reviewed by Sandro Santilli and myself

Discussion: https://postgr.es/m/003001d8f4ae$402282c0$c0678840$@pcorp.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/72a5b1fc880481914da2d4233077438dd87840ca

Modified Files
--------------
doc/src/sgml/extend.sgml                           | 45 +++++++++++-
src/backend/commands/extension.c                   | 81 +++++++++++++++++++++-
src/test/modules/test_extensions/Makefile          |  9 ++-
.../test_extensions/expected/test_extensions.out   | 77 ++++++++++++++++++++
src/test/modules/test_extensions/meson.build       |  6 ++
.../test_extensions/sql/test_extensions.sql        | 23 ++++++
.../test_extensions/test_ext_req_schema1--1.0.sql  |  6 ++
.../test_extensions/test_ext_req_schema1.control   |  3 +
.../test_extensions/test_ext_req_schema2--1.0.sql  |  9 +++
.../test_extensions/test_ext_req_schema2.control   |  4 ++
.../test_extensions/test_ext_req_schema3--1.0.sql  | 12 ++++
.../test_extensions/test_ext_req_schema3.control   |  5 ++
12 files changed, 272 insertions(+), 8 deletions(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: pgsql: doc/PDF: Add page breaks for in contrib appendix
Next
From: Andres Freund
Date:
Subject: pgsql: meson: rename html_help target to htmlhelp