postgresql.git
5 weeks agoUpdate obsolete comment in ExecScanReScan().
Etsuro Fujita [Thu, 6 Nov 2025 03:25:00 +0000 (12:25 +0900)]
Update obsolete comment in ExecScanReScan().

Commit 27cc7cd2b removed the epqScanDone flag from the EState struct,
and instead added an equivalent flag named relsubs_done to the EPQState
struct; but it failed to update this comment.

Author: Etsuro Fujita <etsuro.fujita@gmail.com>
Discussion: https://postgr.es/m/CAPmGK152zJ3fU5avDT5udfL0namrDeVfMTL3dxdOXw28SOrycg%40mail.gmail.com
Backpatch-through: 13

5 weeks agopostgres_fdw: Add more test coverage for EvalPlanQual testing.
Etsuro Fujita [Thu, 6 Nov 2025 03:15:00 +0000 (12:15 +0900)]
postgres_fdw: Add more test coverage for EvalPlanQual testing.

postgres_fdw supports EvalPlanQual testing by using the infrastructure
provided by the core with the RecheckForeignScan callback routine (cf.
commits 5fc4c26db and 385f337c9), but there has been no test coverage
for that, except that recent commit 12609fbac, which fixed an issue in
commit 385f337c9, added a test case to exercise only a code path added
by that commit to the core infrastructure.  So let's add test cases to
exercise other code paths as well at this time.

Like commit 12609fbac, back-patch to all supported branches.

Reported-by: Masahiko Sawada <sawada.mshk@gmail.com>
Author: Etsuro Fujita <etsuro.fujita@gmail.com>
Discussion: https://postgr.es/m/CAPmGK15%2B6H%3DkDA%3D-y3Y28OAPY7fbAdyMosVofZZ%2BNc769epVTQ%40mail.gmail.com
Backpatch-through: 13

5 weeks agoDoc: use uppercase keywords in SQLs
David Rowley [Thu, 6 Nov 2025 03:03:02 +0000 (16:03 +1300)]
Doc: use uppercase keywords in SQLs

Use uppercase SQL keywords consistently throughout the documentation to
ease reading.  Also add whitespace in a couple of places where it
improves readability.

Author: Erik Wienhold <ewie@ewie.name>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/82eb512b-8ed2-46be-b311-54ffd26978c4%40ewie.name

5 weeks agoUse stack allocated StringInfoDatas, where possible
David Rowley [Thu, 6 Nov 2025 01:59:48 +0000 (14:59 +1300)]
Use stack allocated StringInfoDatas, where possible

Various places that were using StringInfo but didn't need that
StringInfo to exist beyond the scope of the function were using
makeStringInfo(), which allocates both a StringInfoData and the buffer it
uses as two separate allocations.  It's more efficient for these cases to
use a StringInfoData on the stack and initialize it with initStringInfo(),
which only allocates the string buffer.  This also simplifies the cleanup,
in a few cases.

Author: Mats Kindahl <mats.kindahl@gmail.com>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/4379aac8-26f1-42f2-a356-ff0e886228d3@gmail.com

5 weeks agoci: Add missing "set -e" to scripts run by su.
Thomas Munro [Thu, 6 Nov 2025 00:24:30 +0000 (13:24 +1300)]
ci: Add missing "set -e" to scripts run by su.

If any shell command fails, the whole script should fail.  To avoid
future omissions, add this even for single-command scripts that use su
with heredoc syntax, as they might be extended or copied-and-pasted.

Extracted from a larger patch that wanted to use #error during
compilation, leading to the diagnosis of this problem.

Reviewed-by: Tristan Partin <tristan@partin.io> (earlier version)
Discussion: https://postgr.es/m/DDZP25P4VZ48.3LWMZBGA1K9RH%40partin.io
Backpatch-through: 15

5 weeks agoAvoid possible crash within libsanitizer.
Tom Lane [Wed, 5 Nov 2025 16:09:30 +0000 (11:09 -0500)]
Avoid possible crash within libsanitizer.

We've successfully used libsanitizer for awhile with the undefined
and align