pgsql: Fix intermittent BF failure in 040_standby_failover_slots_sync.

2025-12-17 Thread Amit Kapila
Fix intermittent BF failure in 040_standby_failover_slots_sync. Commit 0d2d4a0ec3 introduced a test that verifies replication slot synchronization to a standby server via SQL API. However, the test did not configure synchronized_standby_slots. Without this setting, logical failover slots can advan

pgsql: btree_gist: Fix memory allocation formula

2025-12-17 Thread Michael Paquier
btree_gist: Fix memory allocation formula This change has been suggested by the two authors listed in this commit, both of them providing an incomplete solution (David's formula relied on a "bytea *", while Bertrand's did not use palloc_array()). The solution provided in this commit uses GBT_VARK

Re: pgsql: Fix remaining race condition with CLOG truncation and LISTEN/NOT

2025-12-17 Thread Michael Paquier
Hi Heikki, On Wed, Nov 12, 2025 at 07:16:38PM +, Heikki Linnakangas wrote: > Fix remaining race condition with CLOG truncation and LISTEN/NOTIFY > > Previous commit fixed a bug where VACUUM would truncate the CLOG > that's still needed to check the commit status of XIDs in the async > notify

pgsql: Fix const correctness in pgstat data serialization callbacks

2025-12-17 Thread Michael Paquier
Fix const correctness in pgstat data serialization callbacks 4ba012a8ed9c defined the "header" (pointer to the stats data) of from_serialized_data() as a const, even though it is fine (and expected!) for the callback to modify the shared memory entry when loading the stats at startup. While on it

pgsql: libpq-oauth: use correct c_args in meson.build

2025-12-17 Thread Jacob Champion
libpq-oauth: use correct c_args in meson.build Copy-paste bug from b0635bfda: libpq-oauth.so was being built with libpq_so_c_args, rather than libpq_oauth_so_c_args. (At the moment, the two lists are identical, but that won't be true forever.) Reviewed-by: Chao Li Discussion: https://postgr.es/

pgsql: libpq-fe.h: Don't claim SOCKTYPE in the global namespace

2025-12-17 Thread Jacob Champion
libpq-fe.h: Don't claim SOCKTYPE in the global namespace The definition of PGoauthBearerRequest uses a temporary SOCKTYPE macro to hide the difference between Windows and Berkeley socket handles, since we don't surface pgsocket in our public API. This macro doesn't need to escape the header, becau

pgsql: libpq-fe.h: Don't claim SOCKTYPE in the global namespace

2025-12-17 Thread Jacob Champion
libpq-fe.h: Don't claim SOCKTYPE in the global namespace The definition of PGoauthBearerRequest uses a temporary SOCKTYPE macro to hide the difference between Windows and Berkeley socket handles, since we don't surface pgsocket in our public API. This macro doesn't need to escape the header, becau

pgsql: libpq-oauth: use correct c_args in meson.build

2025-12-17 Thread Jacob Champion
libpq-oauth: use correct c_args in meson.build Copy-paste bug from b0635bfda: libpq-oauth.so was being built with libpq_so_c_args, rather than libpq_oauth_so_c_args. (At the moment, the two lists are identical, but that won't be true forever.) Reviewed-by: Chao Li Discussion: https://postgr.es/

pgsql: oauth_validator: Avoid races in log_check()

2025-12-17 Thread Jacob Champion
oauth_validator: Avoid races in log_check() Commit e0f373ee4 fixed up races in Cluster::connect_fails when using log_like. t/002_client.pl didn't get the memo, though, because it doesn't use Test::Cluster to perform its custom hook tests. (This is probably not an issue at the moment, since the log

pgsql: oauth_validator: Avoid races in log_check()

2025-12-17 Thread Jacob Champion
oauth_validator: Avoid races in log_check() Commit e0f373ee4 fixed up races in Cluster::connect_fails when using log_like. t/002_client.pl didn't get the memo, though, because it doesn't use Test::Cluster to perform its custom hook tests. (This is probably not an issue at the moment, since the log

pgsql: Rename regress.so's .mo file to postgresql-regress-VERSION.mo.

2025-12-17 Thread Tom Lane
Rename regress.so's .mo file to postgresql-regress-VERSION.mo. I originally used just "regress-VERSION.mo", but that seems too generic considering that some packagers will put this file into a system-wide directory. Per suggestion from Christoph Berg. Reported-by: Christoph Berg Author: Tom Lan

pgsql: Update .abi-compliance-history for PrepareToInvalidateCacheTuple

2025-12-17 Thread Noah Misch
Update .abi-compliance-history for PrepareToInvalidateCacheTuple(). Commit 0f69beddea113dd1d6c5b6f6d82df577ef3c21f2 (v17) anticipated this: [C] 'function void PrepareToInvalidateCacheTuple(Relation, HeapTuple, HeapTuple, void (int, typedef uint32, typedef Oid)*)' has some sub-type changes:

pgsql: Update .abi-compliance-history for PrepareToInvalidateCacheTuple

2025-12-17 Thread Noah Misch
Update .abi-compliance-history for PrepareToInvalidateCacheTuple(). Commit 0f69beddea113dd1d6c5b6f6d82df577ef3c21f2 (v17) anticipated this: [C] 'function void PrepareToInvalidateCacheTuple(Relation, HeapTuple, HeapTuple, void (int, typedef uint32, typedef Oid)*)' has some sub-type changes:

pgsql: Update .abi-compliance-history for PrepareToInvalidateCacheTuple

2025-12-17 Thread Noah Misch
Update .abi-compliance-history for PrepareToInvalidateCacheTuple(). Commit 0f69beddea113dd1d6c5b6f6d82df577ef3c21f2 (v17) anticipated this: [C] 'function void PrepareToInvalidateCacheTuple(Relation, HeapTuple, HeapTuple, void (int, typedef uint32, typedef Oid)*)' has some sub-type changes:

pgsql: Update .abi-compliance-history for PrepareToInvalidateCacheTuple

2025-12-17 Thread Noah Misch
Update .abi-compliance-history for PrepareToInvalidateCacheTuple(). Commit 0f69beddea113dd1d6c5b6f6d82df577ef3c21f2 (v17) anticipated this: [C] 'function void PrepareToInvalidateCacheTuple(Relation, HeapTuple, HeapTuple, void (int, typedef uint32, typedef Oid)*)' has some sub-type changes:

pgsql: Make postmaster 003_start_stop.pl test less flaky

2025-12-17 Thread Heikki Linnakangas
Make postmaster 003_start_stop.pl test less flaky The test is very sensitive to how backends start and exit, because it tests dead-end backends which occur when all the connection slots are in use. The test failed occasionally in the CI, when the backend that was launched for the raw_connect_works

pgsql: Make postmaster 003_start_stop.pl test less flaky

2025-12-17 Thread Heikki Linnakangas
Make postmaster 003_start_stop.pl test less flaky The test is very sensitive to how backends start and exit, because it tests dead-end backends which occur when all the connection slots are in use. The test failed occasionally in the CI, when the backend that was launched for the raw_connect_works

Re: pgsql: Revert "Avoid requiring Spanish locale to test NLS infrastructur

2025-12-17 Thread Christoph Berg
Re: Tom Lane > src/test/regress/po/es.po | 159 +++ The Debian package builds are complaining that there is now a usr/share/locale/es/LC_MESSAGES/regress-19.mo file that needs sorting into one of the .deb packages. Since regress.so itself doesn't get insta

pgsql: Support existing publications in pg_createsubscriber.

2025-12-17 Thread Amit Kapila
Support existing publications in pg_createsubscriber. Allow pg_createsubscriber to reuse existing publications instead of failing when they already exist on the publisher. Previously, pg_createsubscriber would fail if any specified publication already existed. Now, existing publications are reuse