PostgreSQL 9.4.27 (not released) commit log

Create common infrastructure for cross-version upgrade testing.

commit   : 4bcf3521290af5317b6ff1f5ae98682e96a3013f    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 16 Jan 2023 20:35:53 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 16 Jan 2023 20:35:53 -0500    

Click here for diff

To test pg_upgrade across major PG versions, we have to be able to  
modify or drop any old objects with no-longer-supported properties,  
and we have to be able to deal with cosmetic changes in pg_dump output.  
Up to now, the buildfarm and pg_upgrade's own test infrastructure had  
separate implementations of the former, and we had nothing but very  
ad-hoc rules for the latter (including an arbitrary threshold on how  
many lines of unchecked diff were okay!).  This patch creates a Perl  
module that can be shared by both those use-cases, and adds logic  
that deals with pg_dump output diffs in a much more tightly defined  
fashion.  
  
This largely supersedes previous efforts in commits 0df9641d3,  
9814ff550, and 62be9e4cd, which developed a SQL-script-based solution  
for the task of dropping old objects.  There was nothing fundamentally  
wrong with that work in itself, but it had no basis for solving the  
output-formatting problem.  The most plausible way to deal with  
formatting is to build a Perl module that can perform editing on the  
dump files; and once we commit to that, it makes more sense for the  
same module to also embed the knowledge of what has to be done for  
dropping old objects.  
  
Back-patch versions of the helper module as far as 9.2, to  
support buildfarm animals that still test that far back.  
It's also necessary to back-patch PostgreSQL/Version.pm,  
because the new code depends on that.  I fixed up pg_upgrade's  
002_pg_upgrade.pl in v15, but did not look into back-patching  
it further than that.  
  
Tom Lane and Andrew Dunstan  
  
Discussion: https://postgr.es/m/[email protected]  

A src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
A src/test/perl/PostgreSQL/Version.pm

Account for IPC::Run::result() Windows behavior change.

commit   : 50bee42021b586c8420dc9f4d9488a6c79bd6b2d    
  
author   : Noah Misch <[email protected]>    
date     : Thu, 17 Nov 2022 07:35:06 -0800    
  
committer: Noah Misch <[email protected]>    
date     : Thu, 17 Nov 2022 07:35:06 -0800    

Click here for diff

This restores compatibility with the not-yet-released successor of  
version 20220807.0.  Back-patch to 9.4, which introduced this code.  
  
Reviewed by Andrew Dunstan.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/test/perl/TestLib.pm

Fix compilation warnings with libselinux 3.1 in contrib/sepgsql/

commit   : 0f5812df659b6e40f910d13896584c3e0e765d76    
  
author   : Michael Paquier <[email protected]>    
date     : Wed, 9 Nov 2022 09:40:05 +0900    
  
committer: Michael Paquier <[email protected]>    
date     : Wed, 9 Nov 2022 09:40:05 +0900    

Click here for diff

Upstream SELinux has recently marked security_context_t as officially  
deprecated, causing warnings with -Wdeprecated-declarations.  This is  
considered as legacy code for some time now by upstream as  
security_context_t got removed from most of the code tree during the  
development of 2.3 back in 2014.  
  
This removes all the references to security_context_t in sepgsql/ to be  
consistent with SELinux, fixing the warnings.  Note that this does not  
impact the minimum version of libselinux supported.  
  
This has been applied first as 1f32136 for 14~, but no other branches  
got the call.  This is in line with the recent project policy to have no  
warnings in branches where builds should still be supported (9.2~ as of  
today).  Per discussion with Tom Lane and Álvaro Herrera.  
  
Reviewed-by: Tom Lane  
Discussion: https://postgr.es/m/[email protected]  
Discussion: https://postgr.es/m/[email protected]  
Backpatch-through: 9.2  

M contrib/sepgsql/label.c
M contrib/sepgsql/selinux.c
M contrib/sepgsql/uavc.c

Rename parser token REF to REF_P to avoid a symbol conflict.

commit   : 57dfb6ce61e0d04c525a7a0d251f17da871c6355    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 16 Oct 2022 15:27:04 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 16 Oct 2022 15:27:04 -0400    

Click here for diff

In the latest version of Apple's macOS SDK, <sys/socket.h>  
fails to compile if "REF" is #define'd as something.  
Apple may or may not agree that this is a bug, and even if  
they do accept the bug report I filed, they probably won't  
fix it very quickly.  In the meantime, our back branches will all  
fail to compile gram.y.  v15 and HEAD currently escape the problem  
thanks to the refactoring done in 98e93a1fc, but that's purely  
accidental.  Moreover, since that patch removed a widely-visible  
inclusion of <netdb.h>, back-patching it seems too likely to break  
third-party code.  
  
Instead, change the token's code name to REF_P, following our usual  
convention for naming parser tokens that are likely to have symbol  
conflicts.  The effects of that should be localized to the grammar  
and immediately surrounding files, so it seems like a safer answer.  
  
Per project policy that we want to keep recently-out-of-support  
branches buildable on modern systems, back-patch all the way to 9.2.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/parser/gram.y
M src/include/parser/kwlist.h

Suppress more variable-set-but-not-used warnings from clang 15.

commit   : 3c5a33a52e3a4126679fadd67d215032fdb9c65b    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 21 Sep 2022 13:52:38 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 21 Sep 2022 13:52:38 -0400    

Click here for diff

Mop up assorted set-but-not-used warnings in the back branches.  
This includes back-patching relevant fixes from commit 152c9f7b8  
the rest of the way, but there are also several cases that did not  
appear in HEAD.  Some of those we'd fixed in a retail way but not  
back-patched, and others I think just got rewritten out of existence  
during nearby refactoring.  
  
While here, also back-patch b1980f6d0 (PL/Tcl: Fix compiler warnings  
with Tcl 8.6) into 9.2, so that that branch compiles warning-free  
with modern Tcl.  
  
Per project policy, this is a candidate for back-patching into  
out-of-support branches: it suppresses annoying compiler warnings  
but changes no behavior.  Hence, back-patch all the way to 9.2.  
  
Discussion: https://postgr.es/m/[email protected]  

M contrib/hstore/crc32.c
M contrib/ltree/crc32.c
M src/backend/access/transam/xlog.c
M src/backend/optimizer/util/var.c
M src/backend/parser/gram.y
M src/backend/utils/adt/array_typanalyze.c
M src/backend/utils/adt/varlena.c

Disable -Wdeprecated-non-prototype in the back branches.

commit   : 7d5d3f05bfab42b7858a104df5931519afffeee9    
  
author   : Tom Lane <[email protected]>    
date     : Tue, 20 Sep 2022 18:59:53 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Tue, 20 Sep 2022 18:59:53 -0400    

Click here for diff

There doesn't seem to be any good ABI-preserving way to silence  
clang 15's -Wdeprecated-non-prototype warnings about our tree-walk  
APIs.  While we've fixed it properly in HEAD, the only way to not  
see hundreds of these in the back branches is to disable the  
warnings.  We're not going to do anything about them, so we might  
as well disable them.  
  
I noticed that we also get some of these warnings about fmgr.c's  
support for V0 function call convention, in branches before v10  
where we removed that.  That's another area we aren't going to  
change, so turning off the warning seems fine for that too.  
  
Per project policy, this is a candidate for back-patching into  
out-of-support branches: it suppresses annoying compiler warnings  
but changes no behavior.  Hence, back-patch all the way to 9.2.  
  
Discussion: https://postgr.es/m/CA+hUKGKpHPDTv67Y+s6yiC8KH5OXeDg6a-twWo_xznKTcG0kSA@mail.gmail.com  

M configure
M configure.in

Fix pl/perl test case so it will still work under Perl 5.36.

commit   : b53780e1beebf496f2ee4f8b4ad2b51ac85efbcc    
  
author   : Tom Lane <[email protected]>    
date     : Wed, 1 Jun 2022 16:15:47 -0400    
  
committer: Tom Lane <[email protected]>    
date     : Wed, 1 Jun 2022 16:15:47 -0400    

Click here for diff

Perl 5.36 has reclassified the warning condition that this test  
case used, so that the expected error fails to appear.  Tweak  
the test so it instead exercises a case that's handled the same  
way in all Perl versions of interest.  
  
This appears to meet our standards for back-patching into  
out-of-support branches: it changes no user-visible behavior  
but enables testing of old branches with newer tools.  
Hence, back-patch as far as 9.2.  
  
Dagfinn Ilmari Mannsåker, per report from Jitka Plesníková.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/pl/plperl/expected/plperl.out
M src/pl/plperl/sql/plperl.sql

Use gendef instead of pexports for building windows .def files

commit   : c76164ea02aa3aebeff59d7d633a6107cb753772    
  
author   : Andrew Dunstan <[email protected]>    
date     : Thu, 10 Feb 2022 13:44:05 -0500    
  
committer: Andrew Dunstan <[email protected]>    
date     : Thu, 10 Feb 2022 13:44:05 -0500    

Click here for diff

Modern msys systems lack pexports but have gendef instead, so use that.  
  
Discussion: https://postgr.es/m/[email protected]  
  
Backpatch to release 9.4 to enable building with perl on older branches.  
Before that pexports is not used for plperl.  

M src/pl/plperl/GNUmakefile
M src/pl/plpython/Makefile
M src/pl/tcl/Makefile

Suppress variable-set-but-not-used warning from clang 13.

commit   : 927e235aa0f6ce598eee9f251e09653a015974d8    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 23 Jan 2022 11:09:00 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 23 Jan 2022 11:09:00 -0500    

Click here for diff

In the normal configuration where GEQO_DEBUG isn't defined,  
recent clang versions have started to complain that geqo_main.c  
accumulates the edge_failures count but never does anything  
with it.  As a minimal back-patchable fix, insert a void cast  
to silence this warning.  (I'd speculated about ripping out the  
GEQO_DEBUG logic altogether, but I don't think we'd wish to  
back-patch that.)  
  
Per recently-established project policy, this is a candidate  
for back-patching into out-of-support branches: it suppresses  
an annoying compiler warning but changes no behavior.  Hence,  
back-patch all the way to 9.2.  
  
Discussion: https://postgr.es/m/CA+hUKGLTSZQwES8VNPmWO9AO0wSeLt36OCPDAZTccT1h7Q7kTQ@mail.gmail.com  

M src/backend/optimizer/geqo/geqo_main.c

Silence another gcc 11 warning.

commit   : 0af208402d0a5cede0e8c9007112233032dab639    
  
author   : Tom Lane <[email protected]>    
date     : Mon, 13 Dec 2021 00:08:27 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Mon, 13 Dec 2021 00:08:27 -0500    

Click here for diff

Per buildfarm and local experimentation, bleeding-edge gcc isn't  
convinced that the MemSet in reorder_function_arguments() is safe.  
Shut it up by adding an explicit check that pronargs isn't negative,  
and by changing MemSet to memset.  (It appears that either change is  
enough to quiet the warning at -O2, but let's do both to be sure.)  
  
This back-patches commit 1046dbedd into out-of-support branches,  
pursuant to newly-established project policy.  The point is to  
suppress scary-looking warnings so that people building these  
branches needn't expend brain cells verifying that it's safe  
to ignore the warnings.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/backend/optimizer/util/clauses.c

Suppress -Warray-parameter warnings in pgcrypto/sha2.c.

commit   : 25c8e5ef077ed726bfec93dffd4f7870b7ed4313    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 12 Dec 2021 20:24:46 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 12 Dec 2021 20:24:46 -0500    

Click here for diff

This is exactly the same problem as commit 1b242f42b fixed in ecpg,  
but in contrib/pgcrypto.  Commit 273c458a2 eliminated the problem  
here for v10 and up.  We hadn't noticed for exactly the same reasons  
enumerated in bbbf22cf3.  
  
Back-patch down to 9.2, pursuant to newly-established project policy  
about keeping out-of-support branches buildable.  
  
Discussion: https://postgr.es/m/[email protected]  

M contrib/pgcrypto/sha2.c

Reformat imath.c macro to remove -Wmisleading-indentation warnings.

commit   : 5eb73fc9347d0e1b89d5053a8657d6dc0e87f9d7    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 12 Dec 2021 19:12:18 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 12 Dec 2021 19:12:18 -0500    

Click here for diff

Recent versions of gcc whine about the admittedly-completely-illegible  
formatting of this macro.  We've not noticed for a few reasons:  
  
* In v12 and up, the problem is gone thanks to 48e24ba6b.  
(Back-patching that doesn't seem prudent, though, so this patch  
just manually improves the macro's formatting.)  
  
* Buildfarm animals that might have complained, such as caiman,  
do not because they use --with-openssl and so don't build imath.c.  
  
* In a manual run such as "make all check-world", you won't see the  
warning because it gets buried in an install.log file.  You have to  
do "make -C contrib all" or the like to see it.  
  
I noticed this because in older branches, the last bit doesn't  
happen so "check-world" actually does spew the warnings to stderr.  
Maybe we should rethink how that works, because the newer behavior  
is not an improvement IMO.  
  
Back-patch down to 9.2, pursuant to newly-established project policy  
about keeping out-of-support branches buildable.  
  
Discussion: https://postgr.es/m/[email protected]  

M contrib/pgcrypto/imath.c

Clean up compilation warnings coming from PL/Perl with clang-12~

commit   : 3fff9b6c1856cd99c09dff2d8da05d0482bc96e2    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 12 Dec 2021 18:06:07 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 12 Dec 2021 18:06:07 -0500    

Click here for diff

clang-12 has introduced -Wcompound-token-split-by-macro, that is causing  
a large amount of warnings when building PL/Perl because of its  
interactions with upstream Perl.  This commit adds one -Wno to CFLAGS at  
./configure time if the flag is supported by the compiler to silence all  
those warnings.  
  
This back-patches commit 9ff47ea41 into out-of-support branches,  
pursuant to newly-established project policy.  The point is to  
suppress scary-looking warnings so that people building these  
branches needn't expend brain cells verifying that it's safe  
to ignore the warnings.  
  
Discussion: https://postgr.es/m/[email protected]  

M configure
M configure.in

Make ecpg's rjulmdy() and rmdyjul() agree with their declarations.

commit   : 9ae132dfe37342f2001e6764d2eb5f1eaab05f0e    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 12 Dec 2021 16:59:14 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 12 Dec 2021 16:59:14 -0500    

Click here for diff

We had "short *mdy" in the extern declarations, but "short mdy[3]"  
in the actual function definitions.  Per C99 these are equivalent,  
but recent versions of gcc have started to issue warnings about  
the inconsistency.  Clean it up before the warnings get any more  
widespread.  
  
This back-patches commit 1b242f42b into out-of-support branches,  
pursuant to newly-established project policy.  The point is to  
suppress scary-looking warnings so that people building these  
branches needn't expend brain cells verifying that it's safe  
to ignore the warnings.  
  
Discussion: https://postgr.es/m/[email protected]  

M src/interfaces/ecpg/compatlib/informix.c

Use return instead of exit() in configure

commit   : 47fca011b88a9c0eadf2b62f6c1943deae0631c3    
  
author   : Tom Lane <[email protected]>    
date     : Sun, 12 Dec 2021 14:54:26 -0500    
  
committer: Tom Lane <[email protected]>    
date     : Sun, 12 Dec 2021 14:54:26 -0500    

Click here for diff

Using exit() requires stdlib.h, which is not included.  Use return  
instead.  Also add return type for main().  
  
This back-patches commit 1c0cf52b3 into out-of-support branches,  
pursuant to a newly-established project policy that we'll try to keep  
out-of-support branches buildable on modern platforms for at least  
ten major releases back, ensuring people can test pg_dump and psql  
compatibility against servers that far back.  With the current  
development branch being v15, that works out to keeping 9.2 and up  
buildable as of today.  
  
This fix is needed to get through 'configure' when using recent  
macOS (and possibly other clang-based toolchains).  It seems to  
be sufficient to get through 'check-world', although there are  
annoyances such as compiler warnings, which will be dealt with  
separately.  
  
Original patch by Peter Eisentraut  
  
Discussion: https://postgr.es/m/[email protected]  

M config/c-compiler.m4
M config/c-library.m4
M configure