pgsql: Adjust overstrong nbtree skip array assertion.

2025-04-30 Thread Peter Geoghegan
Adjust overstrong nbtree skip array assertion. Make an nbtree array preprocessing assertion account for scans that add fewer skip arrays than initially expected due to preprocessing finding an unsatisfiable array qual. Oversight in commit 92fe23d9. Author: Peter Geoghegan Reported-By: Mark Dilg

pgsql: doc: Mention cost-based delays for total_[auto]{vacuum,analyze}_

2025-04-30 Thread Michael Paquier
doc: Mention cost-based delays for total_[auto]{vacuum,analyze}_time 30a6ed0ce4b has added four attributes to pg_stat_all_tables to track the cumulative time spent in [auto]vacuum and [auto]analyze. It was not mentioned that the vacuum cost-based delays are included in these numbers, which could

pgsql: Convert strncpy to strlcpy

2025-04-30 Thread Daniel Gustafsson
Convert strncpy to strlcpy We try to avoid using strncpy() due to the ease of which it can be misused. Convert this callsite to use strlcpy() instead to match similar codepaths in this file. Suggested-by: Peter Eisentraut Discussion: https://postgr.es/m/2a796830-de2d-4030-b480-d673f6cc5...@eis

Re: pgsql: Improve nbtree skip scan primitive scan scheduling.

2025-04-30 Thread Peter Geoghegan
On Wed, Apr 30, 2025 at 4:11 PM Mark Dilger wrote: > A similar assertion can still be reached on HEAD using the attached (rather > contrived) regression test as of f60420cff66a9089a9b431f9c07f4a29aae4990a: I independently found the same bug just a few hours ago, using an enhanced version of my p

Re: pgsql: Improve nbtree skip scan primitive scan scheduling.

2025-04-30 Thread Mark Dilger
On Mon, Apr 28, 2025 at 9:12 AM Peter Geoghegan wrote: > On Sun, Apr 27, 2025 at 1:06 PM Mark Dilger > wrote: > > I can confirm that your patch fixes the problem, having spent some four > hours trying to find other test cases which still fail, finding none. > > Great. > > I pushed essentially th

pgsql: doc: Add missing reference to track_cost_delay_timing.

2025-04-30 Thread Nathan Bossart
doc: Add missing reference to track_cost_delay_timing. Oversight in commit bb8dff9995. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2d6745a66b12e980fb12bd06d583a66231b5ed5c Modified Files -- doc/src/sgml/monitoring.sgml | 5 + 1 file changed, 5 in

pgsql: Further adjust guidance for running vacuumdb after pg_upgrade.

2025-04-30 Thread Nathan Bossart
Further adjust guidance for running vacuumdb after pg_upgrade. Since pg_upgrade does not transfer the cumulative statistics used to trigger autovacuum and autoanalyze, the server may take much longer than expected to process them post-upgrade. Currently, we recommend analyzing only relations for

pgsql: vacuumdb: Don't skip empty relations in --missing-stats-only mod

2025-04-30 Thread Nathan Bossart
vacuumdb: Don't skip empty relations in --missing-stats-only mode. Presently, --missing-stats-only skips relations with reltuples set to 0 because empty relations don't get optimizer statistics. However, before v14, a reltuples value of 0 was ambiguous: it could either mean the relation is empty,

pgsql: Fix assertion failure in snapshot building

2025-04-30 Thread Daniel Gustafsson
Fix assertion failure in snapshot building Clear any potential stale next_phase_at value from the snapshot builder which otherwise may trip an assertion check ensuring that there is no next_phase_at value. This can be reproduced by running 80 concurrent sessions like the below where $c is a loop

pgsql: Fix assertion failure in snapshot building

2025-04-30 Thread Daniel Gustafsson
Fix assertion failure in snapshot building Clear any potential stale next_phase_at value from the snapshot builder which otherwise may trip an assertion check ensuring that there is no next_phase_at value. This can be reproduced by running 80 concurrent sessions like the below where $c is a loop

pgsql: doc: Alphabetize long options for pg_dump[all].

2025-04-30 Thread Nathan Bossart
doc: Alphabetize long options for pg_dump[all]. The current ordering strategy for these pages is to list the short options in alphabetical order followed by the long options in alphabetical order. If an option has both a short variant and a long variant, the short variant takes precedence. This

Re: pgsql: Add missing string terminator

2025-04-30 Thread Daniel Gustafsson
> On 30 Apr 2025, at 15:14, David Rowley wrote: > On Thu, 1 May 2025 at 00:44, Peter Eisentraut wrote: >> I think it's best in general to use str* for strings and mem* for >> not-strings. That's easier to read and also better for static analyzers >> etc. > > The reason I think memcpy is better

pgsql: Update time zone data files to tzdata release 2025b.

2025-04-30 Thread Tom Lane
Update time zone data files to tzdata release 2025b. DST law changes in Chile: there is a new time zone America/Coyhaique for Chile's Aysén Region, to account for it changing to UTC-03 year-round and thus diverging from America/Santiago. Historical corrections for Iran. Backpatch-through: 13 Br

pgsql: Update time zone data files to tzdata release 2025b.

2025-04-30 Thread Tom Lane
Update time zone data files to tzdata release 2025b. DST law changes in Chile: there is a new time zone America/Coyhaique for Chile's Aysén Region, to account for it changing to UTC-03 year-round and thus diverging from America/Santiago. Historical corrections for Iran. Backpatch-through: 13 Br

pgsql: Update time zone data files to tzdata release 2025b.

2025-04-30 Thread Tom Lane
Update time zone data files to tzdata release 2025b. DST law changes in Chile: there is a new time zone America/Coyhaique for Chile's Aysén Region, to account for it changing to UTC-03 year-round and thus diverging from America/Santiago. Historical corrections for Iran. Backpatch-through: 13 Br

pgsql: Update time zone data files to tzdata release 2025b.

2025-04-30 Thread Tom Lane
Update time zone data files to tzdata release 2025b. DST law changes in Chile: there is a new time zone America/Coyhaique for Chile's Aysén Region, to account for it changing to UTC-03 year-round and thus diverging from America/Santiago. Historical corrections for Iran. Backpatch-through: 13 Br

pgsql: Update time zone data files to tzdata release 2025b.

2025-04-30 Thread Tom Lane
Update time zone data files to tzdata release 2025b. DST law changes in Chile: there is a new time zone America/Coyhaique for Chile's Aysén Region, to account for it changing to UTC-03 year-round and thus diverging from America/Santiago. Historical corrections for Iran. Backpatch-through: 13 Br

pgsql: Update time zone data files to tzdata release 2025b.

2025-04-30 Thread Tom Lane
Update time zone data files to tzdata release 2025b. DST law changes in Chile: there is a new time zone America/Coyhaique for Chile's Aysén Region, to account for it changing to UTC-03 year-round and thus diverging from America/Santiago. Historical corrections for Iran. Backpatch-through: 13 Br

Re: pgsql: Add missing string terminator

2025-04-30 Thread David Rowley
On Thu, 1 May 2025 at 00:44, Peter Eisentraut wrote: > > On 30.04.25 13:56, David Rowley wrote: > > In case you're looking for inspiration on a standard to follow, > > commits such as 586dd5d6a did seem to favour memcpy() when the length > > was known and only use strlcpy() when it wasn't. > > It

Re: pgsql: Add missing string terminator

2025-04-30 Thread Peter Eisentraut
On 30.04.25 13:56, David Rowley wrote: On Wed, 30 Apr 2025 at 23:43, David Rowley wrote: memcpy() would make more sense IMO, since the length is known already. I'm fine with either, however. In case you're looking for inspiration on a standard to follow, commits such as 586dd5d6a did seem to

Re: pgsql: Add missing string terminator

2025-04-30 Thread David Rowley
On Wed, 30 Apr 2025 at 23:43, David Rowley wrote: > memcpy() would make more sense IMO, since the length is > known already. I'm fine with either, however. In case you're looking for inspiration on a standard to follow, commits such as 586dd5d6a did seem to favour memcpy() when the length was kno

Re: pgsql: Add missing string terminator

2025-04-30 Thread David Rowley
On Wed, 30 Apr 2025 at 23:27, Daniel Gustafsson wrote: > How about using strlcpy as suggested by Peter? > > - strncpy(nameptr, "Remaining Totals", namelen); > - nameptr[namelen] = '\0'; > + strlcpy(nameptr, "Remaining Totals", namel

Re: pgsql: Add missing string terminator

2025-04-30 Thread Daniel Gustafsson
> On 30 Apr 2025, at 12:57, David Rowley wrote: > > On Wed, 30 Apr 2025 at 21:36, Daniel Gustafsson > wrote: >> Add missing string terminator > > A possible minor niggle. Would memcpy not be a more suitable function > for this? How about using strlcpy as suggested by Peter? -

Re: pgsql: Add missing string terminator

2025-04-30 Thread David Rowley
On Wed, 30 Apr 2025 at 21:36, Daniel Gustafsson wrote: > Add missing string terminator A possible minor niggle. Would memcpy not be a more suitable function for this? It's just there've been a few efforts in the past to try and minimise the usage of strncpy(). There should really just be a smal

pgsql: Typo and doc fixups for memory context reporting

2025-04-30 Thread Daniel Gustafsson
Typo and doc fixups for memory context reporting This fixes comment and docs typos as well as a small documentation change to make it clearer. Found via post-commit review. Author: Rahila Syed Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/CAH2L28vt16C9xTuK+K7QZvtA3kCNWXOEiT=g

pgsql: Add missing string terminator

2025-04-30 Thread Daniel Gustafsson
Add missing string terminator When copying the string strncpy won't add nul termination since the string length is equal to the length specified. Explicitly set a nul terminator after copying to properly terminate. Found via post-commit review. Author: Rahila Syed Reviewed-by: Daniel Gustafsson

pgsql: Add 918e7287e to .git-blame-ignore-revs

2025-04-30 Thread David Rowley
Add 918e7287e to .git-blame-ignore-revs Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/991407ae86785ef38bb1ebfea679a70bcd76574d Modified Files -- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+)

pgsql: Fix broken indentation

2025-04-30 Thread David Rowley
Fix broken indentation I forgot to run pgindent in d8555e522. Reported-by: Fujii Masao Discussion: https://postgr.es/m/156083c9-eac0-418d-9667-92dec4d6d...@oss.nttdata.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/918e7287ed20eb1fe280ab6c4056ccf94dcd53a8 M