public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: [email protected]
Subject: pgsql: extension_control_path
Date: Wed, 19 Mar 2025 06:08:40 +0000
Message-ID: <[email protected]> (raw)

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/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4f7f7b0375854e2f89876473405a8f21c95012af

Modified Files
--------------
doc/src/sgml/config.sgml                           |  68 ++++
doc/src/sgml/extend.sgml                           |  19 +-
doc/src/sgml/ref/create_extension.sgml             |   6 +-
src/Makefile.global.in                             |  19 +-
src/backend/commands/extension.c                   | 403 +++++++++++++--------
src/backend/utils/fmgr/dfmgr.c                     |  77 ++--
src/backend/utils/misc/guc_tables.c                |  13 +
src/backend/utils/misc/postgresql.conf.sample      |   1 +
src/include/commands/extension.h                   |   2 +
src/include/fmgr.h                                 |   3 +
src/test/modules/test_extensions/Makefile          |   1 +
src/test/modules/test_extensions/meson.build       |   5 +
.../t/001_extension_control_path.pl                |  80 ++++
13 files changed, 512 insertions(+), 185 deletions(-)



view thread (20+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: extension_control_path
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox