pgsql: Add read_stream_{pause,resume}()

2026-03-03 Thread Melanie Plageman
Add read_stream_{pause,resume}() Read stream users can now pause lookahead when no blocks are currently available. After resuming, subsequent read_stream_next_buffer() calls continue lookahead with the previous lookahead distance. This is especially useful for read stream users with self-referent

pgsql: Fix rare instability in recovery TAP test 009_twophase

2026-03-03 Thread Michael Paquier
Fix rare instability in recovery TAP test 009_twophase The phase of the test where we want to check that 2PC transactions prepared on a primary can be committed on a promoted standby relied on an immediate stop of the primary. This logic has a race condition: it could be possible that some record

pgsql: Fix rare instability in recovery TAP test 009_twophase

2026-03-03 Thread Michael Paquier
Fix rare instability in recovery TAP test 009_twophase The phase of the test where we want to check that 2PC transactions prepared on a primary can be committed on a promoted standby relied on an immediate stop of the primary. This logic has a race condition: it could be possible that some record

pgsql: Fix rare instability in recovery TAP test 009_twophase

2026-03-03 Thread Michael Paquier
Fix rare instability in recovery TAP test 009_twophase The phase of the test where we want to check that 2PC transactions prepared on a primary can be committed on a promoted standby relied on an immediate stop of the primary. This logic has a race condition: it could be possible that some record

pgsql: Fix rare instability in recovery TAP test 009_twophase

2026-03-03 Thread Michael Paquier
Fix rare instability in recovery TAP test 009_twophase The phase of the test where we want to check that 2PC transactions prepared on a primary can be committed on a promoted standby relied on an immediate stop of the primary. This logic has a race condition: it could be possible that some record

pgsql: Fix rare instability in recovery TAP test 009_twophase

2026-03-03 Thread Michael Paquier
Fix rare instability in recovery TAP test 009_twophase The phase of the test where we want to check that 2PC transactions prepared on a primary can be committed on a promoted standby relied on an immediate stop of the primary. This logic has a race condition: it could be possible that some record

pgsql: Fix rare instability in recovery TAP test 009_twophase

2026-03-03 Thread Michael Paquier
Fix rare instability in recovery TAP test 009_twophase The phase of the test where we want to check that 2PC transactions prepared on a primary can be committed on a promoted standby relied on an immediate stop of the primary. This logic has a race condition: it could be possible that some record

pgsql: Remove redundant restriction checks in apply_child_basequals

2026-03-03 Thread Richard Guo
Remove redundant restriction checks in apply_child_basequals In apply_child_basequals, after translating a parent relation's restriction quals for a child relation, we simplify each child qual by calling eval_const_expressions. Historically, the code then called restriction_is_always_false and re

pgsql: Remove obsolete SAMESIGN macro

2026-03-03 Thread Richard Guo
Remove obsolete SAMESIGN macro The SAMESIGN macro was historically used as a helper for manual integer overflow checks. However, since commit 4d6ad3125 introduced overflow-aware integer operations, this manual sign-checking logic is no longer necessary. The macro remains defined in brin_minmax_m

pgsql: Add some tests for CREATE OR REPLACE VIEW with column additions

2026-03-03 Thread Michael Paquier
Add some tests for CREATE OR REPLACE VIEW with column additions When working on an already-defined view with matching attributes, CREATE OR REPLACE VIEW would internally generate an ALTER TABLE command with a set of AT_AddColumnToView sub-commands, one for each attribute added. Such a command is

pgsql: Change default value of default_toast_compression to "lz4", when

2026-03-03 Thread Michael Paquier
Change default value of default_toast_compression to "lz4", when available The default value for default_toast_compression was "pglz". The main reason for this choice is that this option is always available, pglz code being embedded in Postgres. However, it is known that LZ4 is more efficient th

pgsql: Reduce the scope of volatile qualifiers

2026-03-03 Thread Peter Eisentraut
Reduce the scope of volatile qualifiers Commit c66a7d75e652 introduced a new "cast discards ‘volatile’" warning (-Wcast-qual) in vac_truncate_clog(). Instead of making use of unvolatize(), remove the warning by reducing the scope of the volatile qualifier (added in commit 2d2e40e3bef) to only 2 f

pgsql: doc: Add restart on failure to example systemd file

2026-03-03 Thread Peter Eisentraut
doc: Add restart on failure to example systemd file The documentation previously had a systemd unit file that would not attempt to recover from process failures such as OOM's, segfaults, etc. This commit adds "Restart=on-failure",` which tells systemd to attempt to restart the process after failu

pgsql: Reduce scope of for-loop-local variables to avoid shadowing

2026-03-03 Thread Álvaro Herrera
Reduce scope of for-loop-local variables to avoid shadowing Adjust a couple of for-loops where a local variable was shadowed by another in the same scope, by renaming it as well as reducing its scope to the containing for-loop. Author: Chao Li Reviewed-by: Peter Smith Reviewed-by: Álvaro Herrer