pgsql: Fix incorrect comment in pgstat_backend.c

2025-09-03 Thread Michael Paquier
Fix incorrect comment in pgstat_backend.c The counters saved from pgWalUsage, used for the difference calculations when flushing the backend WAL stats, are updated when calling pgstat_flush_backend() under PGSTAT_BACKEND_FLUSH_WAL, and not pgstat_report_wal(). The comment updated in this commit r

pgsql: Make libpq_pipeline.c shorter and more uniform via helper functi

2025-09-03 Thread Tom Lane
Make libpq_pipeline.c shorter and more uniform via helper functions. There are many places in this test program that need to consume a PGresult while checking that its PQresultStatus is as-expected, or related tasks such as checking that PQgetResult has nothing more to return. These tasks were op

pgsql: ci: Explicitly enable Meson features

2025-09-03 Thread Jacob Champion
ci: Explicitly enable Meson features Meson's "auto" feature mode silently disables features with missing prerequisites, which is nice for development but can lead to false positives in the CI (such as my commit b0635bfda, which broke OAuth detection on OpenBSD). Use an explicit feature list in the

pgsql: ci: Remove extra PG_TEST_EXTRA from NetBSD/OpenBSD

2025-09-03 Thread Jacob Champion
ci: Remove extra PG_TEST_EXTRA from NetBSD/OpenBSD The PG_TEST_EXTRA environment variable is already set at the top level. As of 3d1aec225, Meson tasks will use this by default, so there's no need for another intermediate variable. Author: Nazir Bilal Yavuz Suggested-by: Peter Eisentraut Discus

pgsql: Fix mistake in new GUC tables source

2025-09-03 Thread Peter Eisentraut
Fix mistake in new GUC tables source Commit 63599896545 had it so that the parameter "debug_discard_caches" did not exist unless DISCARD_CACHES_ENABLED was defined (typically via enabling asserts). This was a mistake, it did not correspond to the prior setup. Several tests use this parameter, so

pgsql: Update outdated references to the SLRU ControlLock

2025-09-03 Thread Michael Paquier
Update outdated references to the SLRU ControlLock SLRU bank locks are referred as "bank locks" or "SLRU bank locks" in the code comments. The comments updated in this commit use the latter term. Oversight in 53c2a97a9266, that has replaced the single ControlLock by the bank control locks. Auth

pgsql: Add max_retention_duration option to subscriptions.

2025-09-03 Thread Amit Kapila
Add max_retention_duration option to subscriptions. This commit introduces a new subscription parameter, max_retention_duration, aimed at mitigating excessive accumulation of dead tuples when retain_dead_tuples is enabled and the apply worker lags behind the publisher. When the time spent advanci

pgsql: Generate GUC tables from .dat file

2025-09-03 Thread Peter Eisentraut
Generate GUC tables from .dat file Store the information in guc_tables.c in a .dat file similar to the catalog data in src/include/catalog/, and generate a part of guc_tables.c from that. The goal is to make it easier to edit that information, and to be able to make changes to the downstream data

pgsql: Stamp 18rc1.

2025-09-03 Thread Tom Lane
Stamp 18rc1. Branch -- REL_18_STABLE Details --- https://git.postgresql.org/pg/commitdiff/6200622301310b1e47a2d5b7e25d098f0a38c551 Modified Files -- configure| 18 +- configure.ac | 2 +- meson.build | 2 +- 3 files changed, 11 insertions(+), 11 deletions(

pgsql: Fix use-after-free issue in slot synchronization.

2025-09-03 Thread Amit Kapila
Fix use-after-free issue in slot synchronization. Author: Shlok Kyal Reviewed-by: Daniel Gustafsson Reviewed-by: Amit Kapila Backpatch-through: 18, where it was introduced Discussion: https://postgr.es/m/canhcyexmrcedzj-rngjam0njhm4y+ttdwsgucfmxcim7bnk...@mail.gmail.com Branch -- REL_18_S

pgsql: Fix planner error when estimating SubPlan cost

2025-09-03 Thread Richard Guo
Fix planner error when estimating SubPlan cost SubPlan nodes are typically built very early, before any RelOptInfos have been constructed for the parent query level. As a result, the simple_rel_array in the parent root has not yet been initialized. Currently, during cost estimation of a SubPlan's

pgsql: Fix planner error when estimating SubPlan cost

2025-09-03 Thread Richard Guo
Fix planner error when estimating SubPlan cost SubPlan nodes are typically built very early, before any RelOptInfos have been constructed for the parent query level. As a result, the simple_rel_array in the parent root has not yet been initialized. Currently, during cost estimation of a SubPlan's

pgsql: Fix planner error when estimating SubPlan cost

2025-09-03 Thread Richard Guo
Fix planner error when estimating SubPlan cost SubPlan nodes are typically built very early, before any RelOptInfos have been constructed for the parent query level. As a result, the simple_rel_array in the parent root has not yet been initialized. Currently, during cost estimation of a SubPlan's

pgsql: Fix planner error when estimating SubPlan cost

2025-09-03 Thread Richard Guo
Fix planner error when estimating SubPlan cost SubPlan nodes are typically built very early, before any RelOptInfos have been constructed for the parent query level. As a result, the simple_rel_array in the parent root has not yet been initialized. Currently, during cost estimation of a SubPlan's

pgsql: Fix planner error when estimating SubPlan cost

2025-09-03 Thread Richard Guo
Fix planner error when estimating SubPlan cost SubPlan nodes are typically built very early, before any RelOptInfos have been constructed for the parent query level. As a result, the simple_rel_array in the parent root has not yet been initialized. Currently, during cost estimation of a SubPlan's

pgsql: Fix planner error when estimating SubPlan cost

2025-09-03 Thread Richard Guo
Fix planner error when estimating SubPlan cost SubPlan nodes are typically built very early, before any RelOptInfos have been constructed for the parent query level. As a result, the simple_rel_array in the parent root has not yet been initialized. Currently, during cost estimation of a SubPlan's

pgsql: Fix planner error when estimating SubPlan cost

2025-09-03 Thread Richard Guo
Fix planner error when estimating SubPlan cost SubPlan nodes are typically built very early, before any RelOptInfos have been constructed for the parent query level. As a result, the simple_rel_array in the parent root has not yet been initialized. Currently, during cost estimation of a SubPlan's