From cd80fc7beac8229432c82d633c29543ed635ccc3 Mon Sep 17 00:00:00 2001 From: Mahendrakar Srinivasarao Date: Sat, 31 Oct 2026 03:11:36 +0000 Subject: [PATCH] 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 parent of that "extension" directory, i.e., SHAREDIR or the extension_control_path element in which the control file was found. 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. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- 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..0663702c402 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 in which the + control file was found. The default behavior is equivalent to + specifying directory = 'extension'. -- 2.43.0