extension_control_path
Peter Eisentraut <peter@eisentraut.org>
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 <peter@eisentraut.org> Co-authored-by: Matheus Alcantara <matheusssilv97@gmail.com> Reviewed-by: David E. Wheeler <david@justatheory.com> Reviewed-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> Reviewed-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Reviewed-by: Niccolò Fei <niccolo.fei@enterprisedb.com> Discussion: https://www.postgresql.org/message-id/flat/E7C7BFFB-8857-48D4-A71F-88B359FADCFD@justatheory.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/config.sgml | modified | +68 −0 |
| doc/src/sgml/extend.sgml | modified | +14 −5 |
| doc/src/sgml/ref/create_extension.sgml | modified | +4 −2 |
| src/backend/commands/extension.c | modified | +261 −142 |
| src/backend/utils/fmgr/dfmgr.c | modified | +48 −29 |
| src/backend/utils/misc/guc_tables.c | modified | +13 −0 |
| src/backend/utils/misc/postgresql.conf.sample | modified | +1 −0 |
| src/include/commands/extension.h | modified | +2 −0 |
| src/include/fmgr.h | modified | +3 −0 |
| src/Makefile.global.in | modified | +12 −7 |
| src/test/modules/test_extensions/Makefile | modified | +1 −0 |
| src/test/modules/test_extensions/meson.build | modified | +5 −0 |
| src/test/modules/test_extensions/t/001_extension_control_path.pl | added | +80 −0 |
Documentation touched
Discussion
- RFC: Additional Directory for Extensions 101 messages · 2024-04-02 → 2025-05-02