pgsql: Fix a few more redundant calls of GetLatestSnapshot()

2025-03-10 Thread Heikki Linnakangas
Fix a few more redundant calls of GetLatestSnapshot() Commit 2367503177 fixed this in RelationFindReplTupleByIndex(), but I missed two other similar cases. Per report from Ranier Vilela. Discussion: https://www.postgresql.org/message-id/caeudqarut1de45wn87f-gb7xmy_hw6x1dfd3sqdhhxp-rmd...@mail.g

pgsql: Add WAL data to backend statistics

2025-03-10 Thread Michael Paquier
Add WAL data to backend statistics This commit adds per-backend WAL statistics, providing the same information as pg_stat_wal, except that it is now possible to know how much WAL activity is happening in each backend rather than an overall aggregate of all the activity. Like pg_stat_wal, the impl

pgsql: Doc: improve description of window function processing.

2025-03-10 Thread Tom Lane
Doc: improve description of window function processing. The previous wording talked about a "single pass over the data", which can be read as promising more than intended (to wit, that only one WindowAgg plan node will be used). What we promise is only what the SQL spec requires, namely that the

Re: pgsql: tests: Fix race condition in postmaster/002_connection_limits

2025-03-10 Thread Andres Freund
Hi, On 2025-03-10 18:46:12 -0400, Andrew Dunstan wrote: > On 2025-03-07 Fr 1:22 PM, Andres Freund wrote: > > tests: Fix race condition in postmaster/002_connection_limits > > > > The test occasionally failed due to unexpected connection limit errors being > > encountered after having waited for F

pgsql: tests: Make postmaster/002_connection_limits deal verbose logs

2025-03-10 Thread Andres Freund
tests: Make postmaster/002_connection_limits deal verbose logs When log_error_verbosity=verbose is configured the test would hand (and then fail), because of the sqlstate being added between log level and message. Make regex cope. Reported-by: Andrew Dunstan Discussion: https://postgr.es/m/c7ba

pgsql: Doc: improve description of window function processing.

2025-03-10 Thread Tom Lane
Doc: improve description of window function processing. The previous wording talked about a "single pass over the data", which can be read as promising more than intended (to wit, that only one WindowAgg plan node will be used). What we promise is only what the SQL spec requires, namely that the

pgsql: Use extended stats for precise estimation of bucket size in hash

2025-03-10 Thread Alexander Korotkov
Use extended stats for precise estimation of bucket size in hash join Recognizing the real-life complexity where columns in the table often have functional dependencies, PostgreSQL's estimation of the number of distinct values over a set of columns can be underestimated (or much rarely, overestima

pgsql: Teach Append to consider tuple_fraction when accumulating subpat

2025-03-10 Thread Alexander Korotkov
Teach Append to consider tuple_fraction when accumulating subpaths. This change is dedicated to more active usage of IndexScan and parameterized NestLoop paths in partitioned cases under an Append node, as it already works with plain tables. As newly added regression tests demonstrate, it should

pgsql: Remove support for temporal RESTRICT foreign keys

2025-03-10 Thread Peter Eisentraut
Remove support for temporal RESTRICT foreign keys It isn't clear how these should behave, so let's wait to implement them until we are sure how to do it. This feature was initially added by commit 89f908a6d0a, so it hasn't been released yet. Author: Paul A. Jungwirth Discussion: https://postgr