public inbox for [email protected]
help / color / mirror / Atom feedAdd documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX
5+ messages / 2 participants
[nested] [flat]
* Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX
@ 2026-03-11 01:07 Michael Paquier <[email protected]>
2026-03-11 03:10 ` Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX zhanghu <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Michael Paquier @ 2026-03-11 01:07 UTC (permalink / raw)
To: Postgres hackers <[email protected]>
Hi all,
d1029bb5a26c has switched the in-core tests suited based on pg_regress
to do path substitutions based on the set of environment variables
listed in $subject, rather than replacements based on input and output
files, generating new files.
These can be really useful for extension developers who maintain SQL
test suites, so how about documenting them?
I'd like to propose the attached patch, for HEAD, so as one does not
need to guess their existence from the SQL files or pg_regress.c.
Thoughts or comments?
--
Michael
diff --git a/doc/src/sgml/regress.sgml b/doc/src/sgml/regress.sgml
index d80dd46c5fdb..e3c4a0525ad7 100644
--- a/doc/src/sgml/regress.sgml
+++ b/doc/src/sgml/regress.sgml
@@ -444,6 +444,59 @@ make check LANG=C ENCODING=EUC_JP
</para>
</sect2>
+ <sect2 id="regress-run-path-substitution">
+ <title>Path Substitution</title>
+
+ <para>
+ The test suites driven by <command>pg_regress</command> can use the
+ following environment variables for path substitutions:
+
+ <variablelist>
+ <varlistentry>
+ <term><literal>PG_ABS_SRCDIR</literal></term>
+ <listitem>
+ <para>
+ Absolute path to the source directory.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>PG_ABS_BUILDDIR</literal></term>
+ <listitem>
+ <para>
+ Absolute path to the build directory.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>PG_DLSUFFIX</literal></term>
+ <listitem>
+ <para>
+ Name of extension for dynamically-loadable modules (e.g.
+ <literal>.so</literal> on Linux).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>PG_LIBDIR</literal></term>
+ <listitem>
+ <para>
+ Absolute path to dynamic libraries.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+
+ These are useful when dealing with function and object loading
+ that require specific paths to work, like paths defined in a
+ <command>CREATE FUNCTION</command> or <command>LOAD</command>
+ command, for example.
+ </para>
+ </sect2>
+
<sect2 id="regress-run-custom-settings">
<title>Custom Server Settings</title>
Attachments:
[text/plain] doc-path-subs.patch (1.7K, 2-doc-path-subs.patch)
download | inline diff:
diff --git a/doc/src/sgml/regress.sgml b/doc/src/sgml/regress.sgml
index d80dd46c5fdb..e3c4a0525ad7 100644
--- a/doc/src/sgml/regress.sgml
+++ b/doc/src/sgml/regress.sgml
@@ -444,6 +444,59 @@ make check LANG=C ENCODING=EUC_JP
</para>
</sect2>
+ <sect2 id="regress-run-path-substitution">
+ <title>Path Substitution</title>
+
+ <para>
+ The test suites driven by <command>pg_regress</command> can use the
+ following environment variables for path substitutions:
+
+ <variablelist>
+ <varlistentry>
+ <term><literal>PG_ABS_SRCDIR</literal></term>
+ <listitem>
+ <para>
+ Absolute path to the source directory.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>PG_ABS_BUILDDIR</literal></term>
+ <listitem>
+ <para>
+ Absolute path to the build directory.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>PG_DLSUFFIX</literal></term>
+ <listitem>
+ <para>
+ Name of extension for dynamically-loadable modules (e.g.
+ <literal>.so</literal> on Linux).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>PG_LIBDIR</literal></term>
+ <listitem>
+ <para>
+ Absolute path to dynamic libraries.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+
+ These are useful when dealing with function and object loading
+ that require specific paths to work, like paths defined in a
+ <command>CREATE FUNCTION</command> or <command>LOAD</command>
+ command, for example.
+ </para>
+ </sect2>
+
<sect2 id="regress-run-custom-settings">
<title>Custom Server Settings</title>
[application/pgp-signature] signature.asc (833B, 3-signature.asc)
download
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX
2026-03-11 01:07 Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX Michael Paquier <[email protected]>
@ 2026-03-11 03:10 ` zhanghu <[email protected]>
2026-03-11 21:34 ` Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX Michael Paquier <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: zhanghu @ 2026-03-11 03:10 UTC (permalink / raw)
To: Michael Paquier <[email protected]>; +Cc: Postgres hackers <[email protected]>
Michael Paquier <[email protected]> 于2026年3月11日周三 09:07写道:
>
> Hi all,
>
> d1029bb5a26c has switched the in-core tests suited based on pg_regress
> to do path substitutions based on the set of environment variables
> listed in $subject, rather than replacements based on input and output
> files, generating new files.
>
> These can be really useful for extension developers who maintain SQL
> test suites, so how about documenting them?
>
> I'd like to propose the attached patch, for HEAD, so as one does not
> need to guess their existence from the SQL files or pg_regress.c.
>
> Thoughts or comments?
> --
> Michael
Hi
The doc changes look good overall. I applied the patch locally and rendered
the documentation to HTML, the new page also looks good.
A few minor nitpicks:
+ <para>
+ Name of extension for dynamically-loadable modules (e.g.
+ <literal>.so</literal> on Linux).
+ </para>
I think we need a "the" before "dynamically-loadable".
+ These are useful when dealing with function and object loading
+ that require specific paths to work, like paths defined in a
+ <command>CREATE FUNCTION</command> or <command>LOAD</command>
+ command, for example.
The ending "for example" sounds redundant, since "like" already conveys the
meaning of "for example".
Best regards,
Zhang Hu
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX
2026-03-11 01:07 Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX Michael Paquier <[email protected]>
2026-03-11 03:10 ` Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX zhanghu <[email protected]>
@ 2026-03-11 21:34 ` Michael Paquier <[email protected]>
2026-03-12 01:37 ` Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX zhanghu <[email protected]>
2026-03-12 07:49 ` Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX Michael Paquier <[email protected]>
0 siblings, 2 replies; 5+ messages in thread
From: Michael Paquier @ 2026-03-11 21:34 UTC (permalink / raw)
To: zhanghu <[email protected]>; +Cc: Postgres hackers <[email protected]>
On Wed, Mar 11, 2026 at 11:10:44AM +0800, zhanghu wrote:
> The doc changes look good overall. I applied the patch locally and rendered
> the documentation to HTML, the new page also looks good.
>
> A few minor nitpicks:
>
> + <para>
> + Name of extension for dynamically-loadable modules (e.g.
> + <literal>.so</literal> on Linux).
> + </para>
>
> I think we need a "the" before "dynamically-loadable".
Don't think this one's necessary here, actually, as it refers to a
general concept around modules.
> + These are useful when dealing with function and object loading
> + that require specific paths to work, like paths defined in a
> + <command>CREATE FUNCTION</command> or <command>LOAD</command>
> + command, for example.
>
> The ending "for example" sounds redundant, since "like" already conveys the
> meaning of "for example".
WFM.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (833B, 2-signature.asc)
download
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX
2026-03-11 01:07 Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX Michael Paquier <[email protected]>
2026-03-11 03:10 ` Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX zhanghu <[email protected]>
2026-03-11 21:34 ` Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX Michael Paquier <[email protected]>
@ 2026-03-12 01:37 ` zhanghu <[email protected]>
1 sibling, 0 replies; 5+ messages in thread
From: zhanghu @ 2026-03-12 01:37 UTC (permalink / raw)
To: Michael Paquier <[email protected]>; +Cc: Postgres hackers <[email protected]>
Michael Paquier <[email protected]> 于2026年3月12日周四 05:34写道:
> On Wed, Mar 11, 2026 at 11:10:44AM +0800, zhanghu wrote:
> > The doc changes look good overall. I applied the patch locally and
> rendered
> > the documentation to HTML, the new page also looks good.
> >
> > A few minor nitpicks:
> >
> > + <para>
> > + Name of extension for dynamically-loadable modules (e.g.
> > + <literal>.so</literal> on Linux).
> > + </para>
> >
> > I think we need a "the" before "dynamically-loadable".
>
> Don't think this one's necessary here, actually, as it refers to a
> general concept around modules.
>
> Sounds good.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX
2026-03-11 01:07 Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX Michael Paquier <[email protected]>
2026-03-11 03:10 ` Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX zhanghu <[email protected]>
2026-03-11 21:34 ` Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX Michael Paquier <[email protected]>
@ 2026-03-12 07:49 ` Michael Paquier <[email protected]>
1 sibling, 0 replies; 5+ messages in thread
From: Michael Paquier @ 2026-03-12 07:49 UTC (permalink / raw)
To: Chao Li <[email protected]>; +Cc: zhanghu <[email protected]>; Postgres hackers <[email protected]>
On Thu, Mar 12, 2026 at 08:08:39AM +0800, Chao Li wrote:
> While the inconsistency is already there and a dedicated cleanup
> might not be worthwhile, my preference is still to limit the
> inconsistency.
Honestly, for some it may come to a difference between American
English (mostly with comma) vs British English (no comma), so at the
end both styles should be OK. I have let that as-is after considering
the whole with fresher eyes. One thing that felt missing is a mention
about \getenv, that one would need to be able to reuse these
variables. Added a paragraph for that, and applied the result.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (833B, 2-signature.asc)
download
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2026-03-12 07:49 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-03-11 01:07 Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX Michael Paquier <[email protected]>
2026-03-11 03:10 ` zhanghu <[email protected]>
2026-03-11 21:34 ` Michael Paquier <[email protected]>
2026-03-12 01:37 ` zhanghu <[email protected]>
2026-03-12 07:49 ` Michael Paquier <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox