extension_control_path
authorPeter Eisentraut <[email protected]>
Wed, 19 Mar 2025 05:57:20 +0000 (06:57 +0100)
committerPeter Eisentraut <[email protected]>
Wed, 19 Mar 2025 06:03:20 +0000 (07:03 +0100)
commit4f7f7b0375854e2f89876473405a8f21c95012af
treec413b2bd115ee78c960607db7986e206ddae96f1
parent2cce0fe440fb3f252a7be70a89298168009a2c15
extension_control_path

The new GUC extension_control_path specifies a path to look for
extension control files.  The default value is $system, which looks in
the compiled-in location, as before.

The path search uses the same code and works in the same way as
dynamic_library_path.

Some use cases of this are: (1) testing extensions during package
builds, (2) installing extensions outside security-restricted
containers like Python.app (on macOS), (3) adding extensions to
PostgreSQL running in a Kubernetes environment using operators such as
CloudNativePG without having to rebuild the base image for each new
extension.

There is also a tweak in Makefile.global so that it is possible to
install extensions using PGXS into an different directory than the
default, using 'make install prefix=/else/where'.  This previously
only worked when specifying the subdirectories, like 'make install
datadir=/else/where/share pkglibdir=/else/where/lib', for purely
implementation reasons.  (Of course, without the path feature,
installing elsewhere was rarely useful.)

Author: Peter Eisentraut <[email protected]>
Co-authored-by: Matheus Alcantara <[email protected]>
Reviewed-by: David E. Wheeler <[email protected]>
Reviewed-by: Gabriele Bartolini <[email protected]>
Reviewed-by: Marco Nenciarini <[email protected]>
Reviewed-by: Niccolò Fei <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/E7C7BFFB-8857-48D4-A71F-88B359FADCFD@justatheory.com
13 files changed:
doc/src/sgml/config.sgml
doc/src/sgml/extend.sgml
doc/src/sgml/ref/create_extension.sgml
src/Makefile.global.in
src/backend/commands/extension.c
src/backend/utils/fmgr/dfmgr.c
src/backend/utils/misc/guc_tables.c
src/backend/utils/misc/postgresql.conf.sample
src/include/commands/extension.h
src/include/fmgr.h
src/test/modules/test_extensions/Makefile
src/test/modules/test_extensions/meson.build
src/test/modules/test_extensions/t/001_extension_control_path.pl [new file with mode: 0644]