From 709f1f7f614edb339c3c55d2a215cbe727b054cb Mon Sep 17 00:00:00 2001 From: Mahendrakar Srinivasarao Date: Sat, 31 Oct 2026 03:11:36 +0000 Subject: [PATCH v2] doc: Fix description of relative extension "directory" setting Commit 81eaaa2c41d 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 installation's base directory, i.e., SHAREDIR or the extension_control_path element used to locate the primary control file, not the "extension" subdirectory of it in which the control file actually resides. This is also what the TAP test in src/test/modules/test_extensions 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. --- doc/src/sgml/config.sgml | 4 +++- doc/src/sgml/extend.sgml | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index f7db2995c3e..bbd12a37af6 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -11703,7 +11703,9 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' A path to search for extensions, specifically extension control files (name.control). 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 + directory. See for details. diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index 63c5ec6d1eb..a283cc259a0 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -674,9 +674,10 @@ RETURNS anycompatible AS ... The directory containing the extension's SQL 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 installation's SHAREDIR directory, or to the + element used to locate + the primary control file. The default behavior is equivalent to + specifying directory = 'extension'. -- 2.43.0