diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2025-05-02 16:25:40 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2025-05-02 16:35:48 +0200 |
commit | 81eaaa2c41dd29b06edf8b234753debbd1a581d5 (patch) | |
tree | dcaff46d93c9bce7ef21a16aec711957b0f9c91e /doc/src | |
parent | a724c7889f74cc4e76e1979f90808decbc744c79 (diff) | |
download | postgresql-81eaaa2c41dd29b06edf8b234753debbd1a581d5.tar.gz postgresql-81eaaa2c41dd29b06edf8b234753debbd1a581d5.zip |
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#0cdf7b7d727cc593b029650daa3c4fbc
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/config.sgml | 15 | ||||
-rw-r--r-- | doc/src/sgml/extend.sgml | 4 |
2 files changed, 10 insertions, 9 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index fd6e3e02890..23d2b1be424 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -11030,16 +11030,17 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' (Use <literal>pg_config --sharedir</literal> to find out the name of this directory.) For example: <programlisting> -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' </programlisting> or, in a Windows environment: <programlisting> -extension_control_path = 'C:\tools\postgresql\extension;H:\my_project\share\extension;$system' +extension_control_path = 'C:\tools\postgresql;H:\my_project\share;$system' </programlisting> - Note that the path elements should typically end in - <literal>extension</literal> if the normal installation layouts are - followed. (The value for <literal>$system</literal> already includes - the <literal>extension</literal> suffix.) + Note that the specified paths elements are expected to have a + subdirectory <filename>extension</filename> which will contain the + <filename>.control</filename> and <filename>.sql</filename> files; the + <filename>extension</filename> suffix is automatically appended to + each path element. </para> <para> @@ -11064,7 +11065,7 @@ extension_control_path = 'C:\tools\postgresql\extension;H:\my_project\share\exte linkend="guc-dynamic-library-path"/> to a correspondent location, for example, <programlisting> -extension_control_path = '/usr/local/share/postgresql/extension:$system' +extension_control_path = '/usr/local/share/postgresql:$system' dynamic_library_path = '/usr/local/lib/postgresql:$libdir' </programlisting> </para> diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index 065bc49c973..63c5ec6d1eb 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -674,7 +674,7 @@ RETURNS anycompatible AS ... <para> The directory containing the extension's <acronym>SQL</acronym> script file(s). Unless an absolute path is given, the name is relative to - the installation's <literal>SHAREDIR</literal> directory. By default, + the directory where the control file was found. By default, the script files are looked for in the same directory where the control file was found. </para> @@ -1836,7 +1836,7 @@ make install prefix=/usr/local/extras linkend="guc-dynamic-library-path"/> to enable the <productname>PostgreSQL</productname> server to find the files: <programlisting> -extension_control_path = '/usr/local/extras/share/postgresql/extension:$system' +extension_control_path = '/usr/local/extras/share/postgresql:$system' dynamic_library_path = '/usr/local/extras/lib/postgresql:$libdir' </programlisting> </para> |