pgsql: Add optional pid parameter to pg_replication_origin_session_setu

2025-09-18 Thread Amit Kapila
Add optional pid parameter to pg_replication_origin_session_setup(). Commit 216a784829c introduced parallel apply workers, allowing multiple processes to share a replication origin. To support this, replorigin_session_setup() was extended to accept a pid argument identifying the process using the

pgsql: Improve few errdetail messages introduced in commit 0d48d393d46.

2025-09-18 Thread Amit Kapila
Improve few errdetail messages introduced in commit 0d48d393d46. Based on suggestions by Tom Lane Reported-by: Kyotaro Horiguchi Author: Zhijie Hou Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/20250916.114644.275726106301941878.horikyota@gmail.com Branch -- master Detail

pgsql: Make XLogFlush() and XLogNeedsFlush() decision-making more consi

2025-09-18 Thread Michael Paquier
Make XLogFlush() and XLogNeedsFlush() decision-making more consistent When deciding which code path to use depending on the state of recovery, XLogFlush() and XLogNeedsFlush() have been relying on different criterias: - XLogFlush() relied on XLogInsertAllowed(). - XLogNeedsFlush() relied on Recove

pgsql: Fix EPQ crash from missing partition pruning state in EState

2025-09-18 Thread Amit Langote
Fix EPQ crash from missing partition pruning state in EState Commit bb3ec16e14 moved partition pruning metadata into PlannedStmt. At executor startup this metadata is used to initialize the EState fields es_part_prune_infos, es_part_prune_states, and es_part_prune_results. EvalPlanQualStart() fai

pgsql: Fix EPQ crash from missing partition pruning state in EState

2025-09-18 Thread Amit Langote
Fix EPQ crash from missing partition pruning state in EState Commit bb3ec16e14 moved partition pruning metadata into PlannedStmt. At executor startup this metadata is used to initialize the EState fields es_part_prune_infos, es_part_prune_states, and es_part_prune_results. EvalPlanQualStart() fai

pgsql: Revert "Avoid race condition between "GRANT role" and "DROP ROLE

2025-09-18 Thread Tom Lane
Revert "Avoid race condition between "GRANT role" and "DROP ROLE"". This reverts commit 98fc31d6499163a0a781aa6f13582a07f09cd7c6. That change allowed DROP OWNED BY to drop grants of the target role to other roles, arguing that nobody would need those privileges anymore. But that's not so: if you'

pgsql: Document and check that PgStat_HashKey has no padding

2025-09-18 Thread Michael Paquier
Document and check that PgStat_HashKey has no padding This change is a tighter rework of 7d85d87f4d5c, which tried to improve the code so as it would work should PgStat_HashKey gain new fields that create padding bytes. However, the previous change is proving to not be enough as some code paths o

Re: pgsql: Move named LWLock tranche requests to shared memory.

2025-09-18 Thread Michael Paquier
On Thu, Sep 18, 2025 at 09:56:44AM -0500, Nathan Bossart wrote: > Thanks for reviewing. Committed. Thanks. batta looks happy now. -- Michael signature.asc Description: PGP signature

pgsql: Add regression expected-files for older OpenSSL in FIPS mode.

2025-09-18 Thread Tom Lane
Add regression expected-files for older OpenSSL in FIPS mode. Cover contrib/pgcrypto, per buildfarm. Author: Tom Lane Discussion: https://postgr.es/m/443709.1757876...@sss.pgh.pa.us Backpatch-through: 17 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e633fa6351bd

pgsql: Add a test harness for the LWLock tranche code.

2025-09-18 Thread Nathan Bossart
Add a test harness for the LWLock tranche code. This code is heavily used and already has decent test coverage, but it lacks a dedicated test suite. This commit changes that. Author: Sami Imseih Co-authored-by: Nathan Bossart Reviewed-by: Bertrand Drouvot Discussion: https://postgr.es/m/CAA5

pgsql: doc PG 18 relnotes: set release date, remove "CURRENT AS OF"

2025-09-18 Thread Bruce Momjian
doc PG 18 relnotes: set release date, remove "CURRENT AS OF" Backpatch-through: 18 only Branch -- REL_18_STABLE Details --- https://git.postgresql.org/pg/commitdiff/144de0341bde9cab7a6b629a3d9041be54486d96 Modified Files -- doc/src/sgml/release-18.sgml | 2 +- 1 file changed

Re: pgsql: Move named LWLock tranche requests to shared memory.

2025-09-18 Thread Nathan Bossart
On Thu, Sep 18, 2025 at 08:49:20AM +0900, Michael Paquier wrote: > Anyway, your comment additions in v3 look fine from here. Thanks for reviewing. Committed. -- nathan

pgsql: Fix re-initialization of LWLock-related shared memory.

2025-09-18 Thread Nathan Bossart
Fix re-initialization of LWLock-related shared memory. When shared memory is re-initialized after a crash, the named LWLock tranche request array that was copied to shared memory will no longer be accessible. To fix, save the pointer to the original array in postmaster's local memory, and switch

pgsql: doc PG 18 relnotes: update description of skip scan item

2025-09-18 Thread Bruce Momjian
doc PG 18 relnotes: update description of skip scan item Reported-by: Peter Geoghegan Discussion: https://postgr.es/m/CAH2-Wz=5aGnkPsLH9u1kZED=m8tkvxx2b9xmgdoe+epo0kx...@mail.gmail.com Backpatch-through: 18 only Branch -- REL_18_STABLE Details --- https://git.postgresql.org/pg/commit

pgsql: Avoid context dependency in test case added by 9a71989a8.

2025-09-18 Thread Tom Lane
Avoid context dependency in test case added by 9a71989a8. It's not quite clear to me why this didn't show up in my local check-world testing, but some of the buildfarm evidently runs this test with a different database name. Adjust the test so that that doesn't affect the reported error messages.