pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make "directory" setting work with extension_control_path
Date: Fri, 02 May 2025 14:44:31 +0000
Message-ID: <E1uArct-000dKK-0a@gemulon.postgresql.org> (raw)

Make "directory" setting work with extension_control_path

The extension_control_path setting (commit 4f7f7b03758) did not
support extensions that set a custom "directory" setting in their
control file.  Very few extensions use that and during the discussion
on the previous commit it was suggested to maybe remove that
functionality.  But a fix was easier than initially thought, so this
just adds that support.  The fix is to use the control->control_dir as
a share dir to return the path of the extension script files.

To make this work more sensibly overall, the directory suffix
"extension" is no longer to be included in the extension_control_path
value.  To quote the patch, it would be

-extension_control_path = '/usr/local/share/postgresql/extension:/home/my_project/share/extension:$system'
+extension_control_path = '/usr/local/share/postgresql:/home/my_project/share:$system'

During the initial patch, there was some discussion on which of these
two approaches would be better, and the committed patch was a 50/50
decision.  But the support for the "directory" setting pushed it the
other way, and also it seems like many people didn't like the previous
behavior much.

Author: Matheus Alcantara <mths.dev@pm.me>
Reviewed-by: Christoph Berg <myon@debian.org>
Reviewed-by: David E. Wheeler <david@justatheory.com>
Discussion: https://www.postgresql.org/message-id/flat/aAi1VACxhjMhjFnb%40msg.df7cb.de#0cdf7b7d727cc593b029650da...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/81eaaa2c41dd29b06edf8b234753debbd1a581d5

Modified Files
--------------
doc/src/sgml/config.sgml                           | 15 ++--
doc/src/sgml/extend.sgml                           |  4 +-
src/backend/commands/extension.c                   | 95 ++++++++++++++++------
.../t/001_extension_control_path.pl                | 93 +++++++++++++++------
4 files changed, 148 insertions(+), 59 deletions(-)



Message-ID: <E1uArct-000dKK-0a@gemulon.postgresql.org>
Permalink:  ../E1uArct-000dKK-0a@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uArct-000dKK-0a@gemulon.postgresql.org

 · 

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: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Make "directory" setting work with extension_control_path
  In-Reply-To: <E1uArct-000dKK-0a@gemulon.postgresql.org>

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

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