From 3e986520e797f61fc05f6d176d0ae35901d9a4b1 Mon Sep 17 00:00:00 2001 From: Mahendrakar Srinivasarao Date: Sat, 31 Oct 2026 03:11:36 +0000 Subject: [PATCH v4 1/2] 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 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 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 | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 7018ca1e3ea..d7b65469948 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -11750,7 +11750,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..9bbc5b56fbf 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -674,9 +674,12 @@ 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 parent of the extension directory where the + primary control file was found, that is, the installation's + SHAREDIR directory, or the corresponding + element. The default + behavior is equivalent to specifying + directory = 'extension'. -- 2.43.0