pgsql: Add TAP test to check recovery when redo LSN is missing

2025-12-15 Thread Michael Paquier
Add TAP test to check recovery when redo LSN is missing This commit provides test coverage for dc7c77f825d7, where the redo record and the checkpoint record finish on different WAL segments with the start of recovery able to detect that the redo record is missing. This test uses a wait injection

pgsql: Fail recovery when missing redo checkpoint record without backup

2025-12-15 Thread Michael Paquier
Fail recovery when missing redo checkpoint record without backup_label This commit adds an extra check at the beginning of recovery to ensure that the redo record of a checkpoint exists before attempting WAL replay, logging a PANIC if the redo record referenced by the checkpoint record could not b

pgsql: Fail recovery when missing redo checkpoint record without backup

2025-12-15 Thread Michael Paquier
Fail recovery when missing redo checkpoint record without backup_label This commit adds an extra check at the beginning of recovery to ensure that the redo record of a checkpoint exists before attempting WAL replay, logging a PANIC if the redo record referenced by the checkpoint record could not b

pgsql: Fail recovery when missing redo checkpoint record without backup

2025-12-15 Thread Michael Paquier
Fail recovery when missing redo checkpoint record without backup_label This commit adds an extra check at the beginning of recovery to ensure that the redo record of a checkpoint exists before attempting WAL replay, logging a PANIC if the redo record referenced by the checkpoint record could not b

pgsql: Fail recovery when missing redo checkpoint record without backup

2025-12-15 Thread Michael Paquier
Fail recovery when missing redo checkpoint record without backup_label This commit adds an extra check at the beginning of recovery to ensure that the redo record of a checkpoint exists before attempting WAL replay, logging a PANIC if the redo record referenced by the checkpoint record could not b

pgsql: Fail recovery when missing redo checkpoint record without backup

2025-12-15 Thread Michael Paquier
Fail recovery when missing redo checkpoint record without backup_label This commit adds an extra check at the beginning of recovery to ensure that the redo record of a checkpoint exists before attempting WAL replay, logging a PANIC if the redo record referenced by the checkpoint record could not b

pgsql: Fail recovery when missing redo checkpoint record without backup

2025-12-15 Thread Michael Paquier
Fail recovery when missing redo checkpoint record without backup_label This commit adds an extra check at the beginning of recovery to ensure that the redo record of a checkpoint exists before attempting WAL replay, logging a PANIC if the redo record referenced by the checkpoint record could not b

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

2025-12-15 Thread Tom Lane
Revert "Avoid requiring Spanish locale to test NLS infrastructure." This reverts commit 7db6809ced4406257a80766e4109c8be8e1ea744. That doesn't seem to work with recent (last couple of years) glibc, and the reasons are obscure. I can't let the farm stay this broken for long. Branch -- master

pgsql: libpq: Align oauth_json_set_error() with other NLS patterns

2025-12-15 Thread Jacob Champion
libpq: Align oauth_json_set_error() with other NLS patterns Now that the prior commits have fixed missing OAuth translations, pull the bespoke usage of libpq_gettext() for OAUTHBEARER parsing into oauth_json_set_error() itself, and make that a gettext trigger as well, to better match what the othe

pgsql: libpq-oauth: Don't translate internal errors

2025-12-15 Thread Jacob Champion
libpq-oauth: Don't translate internal errors Some error messages are generated when OAuth multiplexer operations fail unexpectedly in the client. Álvaro pointed out that these are both difficult to translate idiomatically (as they use internal terminology heavily) and of dubious translation value

pgsql: libpq: Add missing OAuth translations

2025-12-15 Thread Jacob Champion
libpq: Add missing OAuth translations Several strings that should have been translated as they passed through libpq_gettext were not actually being pulled into the translation files, because I hadn't directly wrapped them in one of the GETTEXT_TRIGGERS. Move the responsibility for calling libpq_g

pgsql: libpq: Add missing OAuth translations

2025-12-15 Thread Jacob Champion
libpq: Add missing OAuth translations Several strings that should have been translated as they passed through libpq_gettext were not actually being pulled into the translation files, because I hadn't directly wrapped them in one of the GETTEXT_TRIGGERS. Move the responsibility for calling libpq_g

pgsql: libpq: Align oauth_json_set_error() with other NLS patterns

2025-12-15 Thread Jacob Champion
libpq: Align oauth_json_set_error() with other NLS patterns Now that the prior commits have fixed missing OAuth translations, pull the bespoke usage of libpq_gettext() for OAUTHBEARER parsing into oauth_json_set_error() itself, and make that a gettext trigger as well, to better match what the othe

pgsql: libpq-oauth: Don't translate internal errors

2025-12-15 Thread Jacob Champion
libpq-oauth: Don't translate internal errors Some error messages are generated when OAuth multiplexer operations fail unexpectedly in the client. Álvaro pointed out that these are both difficult to translate idiomatically (as they use internal terminology heavily) and of dubious translation value

pgsql: Allow passing a pointer to GetNamedDSMSegment()'s init callback.

2025-12-15 Thread Nathan Bossart
Allow passing a pointer to GetNamedDSMSegment()'s init callback. This commit adds a new "void *arg" parameter to GetNamedDSMSegment() that is passed to the initialization callback function. This is useful for reusing an initialization callback function for multiple DSM segments. Author: Zsolt Pa

pgsql: Revisit cosmetics of "For inplace update, send nontransactional

2025-12-15 Thread Noah Misch
Revisit cosmetics of "For inplace update, send nontransactional invalidations." This removes a never-used CacheInvalidateHeapTupleInplace() parameter. It adds README content about inplace update visibility in logical decoding. It rewrites other comments. Back-patch to v18, where commit 243e9b40f

pgsql: Revisit cosmetics of "For inplace update, send nontransactional

2025-12-15 Thread Noah Misch
Revisit cosmetics of "For inplace update, send nontransactional invalidations." This removes a never-used CacheInvalidateHeapTupleInplace() parameter. It adds README content about inplace update visibility in logical decoding. It rewrites other comments. Back-patch to v18, where commit 243e9b40f

pgsql: Correct comments of "Fix data loss at inplace update after heap_

2025-12-15 Thread Noah Misch
Correct comments of "Fix data loss at inplace update after heap_update()". This corrects commit a07e03fd8fa7daf4d1356f7cb501ffe784ea6257. Reported-by: Paul A Jungwirth Reported-by: Surya Poondla Reviewed-by: Paul A Jungwirth Discussion: https://postgr.es/m/ca+renywcw+_2qvxerbq+mna6anwavxxmhkc

pgsql: Avoid requiring Spanish locale to test NLS infrastructure.

2025-12-15 Thread Tom Lane
Avoid requiring Spanish locale to test NLS infrastructure. I had supposed that the majority of machines with gettext installed would have most language locales installed, but at least in the buildfarm it turns out less than half have es_ES installed. So depending on that to run the test now seems

pgsql: Remove incorrect declarations in pg_wchar.h.

2025-12-15 Thread Jeff Davis
Remove incorrect declarations in pg_wchar.h. Oversight in commit 9acae56ce0. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/95a19fefdcbe8d7c511971fe3b9554d0bdd4e26a Modified Files

pgsql: Remove unused single-byte char_is_cased() API.

2025-12-15 Thread Jeff Davis
Remove unused single-byte char_is_cased() API. https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/54c41a6deb9df0868da078490ef9c26d1290e490 Modified Files -- src/backend/utils/ad

pgsql: Use multibyte-aware extraction of pattern prefixes.

2025-12-15 Thread Jeff Davis
Use multibyte-aware extraction of pattern prefixes. Previously, like_fixed_prefix() used char-at-a-time logic, which forced it to be too conservative for case-insensitive matching. Introduce like_fixed_prefix_ci(), and use that for case-insensitive pattern prefixes. It uses multibyte and locale-a

pgsql: Add offnum range checks to suppress compile warnings with UBSAN.

2025-12-15 Thread Tom Lane
Add offnum range checks to suppress compile warnings with UBSAN. Late-model gcc with -fsanitize=undefined enabled issues warnings about uses of PageGetItemId() when it can't prove that the offsetNumber is > 0. The call sites where this happens are checking that the offnum is <= PageGetMaxOffsetNu

pgsql: Increase timeout in multixid_conversion upgrade test

2025-12-15 Thread Heikki Linnakangas
Increase timeout in multixid_conversion upgrade test The workload to generate multixids before upgrade is very slow on buildfarm members running with JIT enabled. The workload runs a lot of small queries, so it's unsurprising that JIT makes it slower. On my laptop it nevertheless runs in under 10

pgsql: Improve sanity checks on multixid members length

2025-12-15 Thread Heikki Linnakangas
Improve sanity checks on multixid members length In the server, check explicitly for multixids with zero members. We used to have an assertion for it, but commit d4b7bde418 replaced it with more extensive runtime checks, but it missed the original case of zero members. In the upgrade code, a nega

pgsql: Disable recently added CIC/RI isolation tests

2025-12-15 Thread Álvaro Herrera
Disable recently added CIC/RI isolation tests We have tried to stabilize them several times already, but they are very flaky -- apparently there's some intrinsic instability that's hard to solve with the isolationtester framework. They are very noisy in CI runs (whereas buildfarm has not register

pgsql: Refactor static_assert() support.

2025-12-15 Thread Peter Eisentraut
Refactor static_assert() support. HAVE__STATIC_ASSERT was really a test for GCC statement expressions, as needed for StaticAssertExpr() now that _Static_assert could be assumed to be available through our C11 requirement. This artificially prevented Visual Studio from being able to use static_ass

pgsql: Clarify comment on multixid offset wraparound check

2025-12-15 Thread Heikki Linnakangas
Clarify comment on multixid offset wraparound check Coverity complained that offset cannot be 0 here because there's an explicit check for "offset == 0" earlier in the function, but it didn't see the possibility that offset could've wrapped around to 0. The code is correct, but clarify the comment

pgsql: Clarify comment on multixid offset wraparound check

2025-12-15 Thread Heikki Linnakangas
Clarify comment on multixid offset wraparound check Coverity complained that offset cannot be 0 here because there's an explicit check for "offset == 0" earlier in the function, but it didn't see the possibility that offset could've wrapped around to 0. The code is correct, but clarify the comment

pgsql: Clarify comment on multixid offset wraparound check

2025-12-15 Thread Heikki Linnakangas
Clarify comment on multixid offset wraparound check Coverity complained that offset cannot be 0 here because there's an explicit check for "offset == 0" earlier in the function, but it didn't see the possibility that offset could've wrapped around to 0. The code is correct, but clarify the comment

pgsql: Clarify comment on multixid offset wraparound check

2025-12-15 Thread Heikki Linnakangas
Clarify comment on multixid offset wraparound check Coverity complained that offset cannot be 0 here because there's an explicit check for "offset == 0" earlier in the function, but it didn't see the possibility that offset could've wrapped around to 0. The code is correct, but clarify the comment

pgsql: Clarify comment on multixid offset wraparound check

2025-12-15 Thread Heikki Linnakangas
Clarify comment on multixid offset wraparound check Coverity complained that offset cannot be 0 here because there's an explicit check for "offset == 0" earlier in the function, but it didn't see the possibility that offset could've wrapped around to 0. The code is correct, but clarify the comment

pgsql: Clarify comment on multixid offset wraparound check

2025-12-15 Thread Heikki Linnakangas
Clarify comment on multixid offset wraparound check Coverity complained that offset cannot be 0 here because there's an explicit check for "offset == 0" earlier in the function, but it didn't see the possibility that offset could've wrapped around to 0. The code is correct, but clarify the comment