postgres.git / summary / log / commit / refs

commit    60e0ccfaef3c09b660218b4053daf0e7b177aab3
Author:   Daniel Gustafsson <dgustafsson@postgresql.org>
Date:     Fri Nov 20 20:47:09 2026 +0000

    doc: Fix description of relative extension "directory" setting
    
    Commit 81eaaa2c4 changed the documentation of the 'directory' control
    file parameter to say that a relative path is resolved against the
    directory where the control file was found.  That is not what the code
    does: a relative path is resolved against the base directory, i.e.,
    the parent of the 'extension' directory in which the primary control
    file was found (SHAREDIR or the corresponding extension_control_path
    element).  This is what the test_extensions TAP test expects, and it
    keeps the long-standing convention of "directory = 'extension/foo'"
    (with MODULEDIR) working.
    
    Restore the pre-18 wording, extended to cover extension_control_path,
    and mention in the description of extension_control_path that the
    'directory' setting can cause script files to be loaded from somewhere
    other than the control file's directory.
    
    Backpatch to 18, where the incorrect wording was introduced.
    
    Author: Mahendrakar Srinivasarao <mahendrakarforpg@gmail.com>
    Reviewed-by: Chao Li <li.evan.chao@gmail.com>
    Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com>
    Discussion: https://postgr.es/m/CABkiuWpGiLzDg4D8zRBJ6DHnwYgHqkFxz2gDstXgeOdzh6bdZQ@mail.gmail.com
    Backpatch-through: 18


doc/src/sgml/config.sgml | 4 +++- doc/src/sgml/extend.sgml | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 6496c94dd59..579f52b0f87 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -11708,7 +11708,9 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' A path to search for extensions, specifically extension control files (<filename><replaceable>name</replaceable>.control</filename>). The remaining extension script and secondary control files are then loaded - from the same directory where the primary control file was found. + from the same directory where the primary control file was found, + unless the primary control file specifies a different + <literal>directory</literal>. See <xref linkend="extend-extensions-files"/> for details. </para> diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index 63c5ec6d1eb..9bbc5b56fbf 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -674,9 +674,12 @@ 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 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. + the parent of the <filename>extension</filename> directory where the + primary control file was found, that is, the installation's + <literal>SHAREDIR</literal> directory, or the corresponding + <xref linkend="guc-extension-control-path"/> element. The default + behavior is equivalent to specifying + <literal>directory = 'extension'</literal>. </para> </listitem> </varlistentry> [parent: ecebc02f69a2]