From 02976b0a1718037f73fded250411b013e81fdafa Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Thu, 12 Mar 2026 16:35:58 +0900 Subject: [PATCH] doc: Document variables for path substitution in SQL tests Test suites driven by pg_regress can use the following environment variables for path substitutions since d1029bb5a26c: - PG_ABS_SRCDIR - PG_ABS_BUILDDIR - PG_DLSUFFIX - PG_LIBDIR These variables have never been documented, and they can be useful for out-of-core code based on the options used by the pg_regress command invoked by installcheck (or equivalent) to build paths to libraries for various commands, like LOAD or CREATE FUNCTION. Reviewed-by: Zhang Hu Reviewed-by: Chao Li Discussion: https://postgr.es/m/abDAWzHaesHLDFke@paquier.xyz --- doc/src/sgml/regress.sgml | 64 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/doc/src/sgml/regress.sgml b/doc/src/sgml/regress.sgml index d80dd46c5fd..43f208df272 100644 --- a/doc/src/sgml/regress.sgml +++ b/doc/src/sgml/regress.sgml @@ -444,6 +444,70 @@ make check LANG=C ENCODING=EUC_JP + + Path Substitution + + + The test suites driven by pg_regress can use the + following environment variables for path substitutions: + + + + PG_ABS_SRCDIR + + + Absolute path to the source directory. + + + + + + PG_ABS_BUILDDIR + + + Absolute path to the build directory. + + + + + + PG_DLSUFFIX + + + Name of extension for dynamically-loadable modules (e.g. + .so on Linux). + + + + + + PG_LIBDIR + + + Absolute path to dynamic libraries. + + + + + + + + These variables should be set in the tests with the meta-command + \getenv, like: + +\getenv abs_builddir PG_ABS_BUILDDIR +\getenv abs_srcdir PG_ABS_SRCDIR + + + + + These are useful when dealing with function and object loading + that require specific paths to work, like paths defined in a + CREATE FUNCTION or LOAD + command. + + + Custom Server Settings