pgsql: Optimize nbtree backwards scans.

2024-10-18 Thread Peter Geoghegan
Optimize nbtree backwards scans. Make nbtree backwards scans optimistically access the next page to be read to the left by following a prevPage block number that's now stashed in currPos when the leaf page is first read. This approach matches the one taken during forward scans, which follow a sym

pgsql: Disable autovacuum for tables in stats import tests.

2024-10-18 Thread Jeff Davis
Disable autovacuum for tables in stats import tests. While we haven't observed any test instability, it seems like a good idea to disable autovacuum during the stats import tests. Author: Corey Huinker Discussion: https://postgr.es/m/CADkLM=fajh1Lpcyr_XsMmq-9Z=sgk-u+_zeac7pt0ran3ui...@mail.gmail

pgsql: Adjust documentation for configuring Linux huge pages.

2024-10-18 Thread Nathan Bossart
Adjust documentation for configuring Linux huge pages. The present wording about viewing shared_memory_size_in_huge_pages seems to suggest that the parameter cannot be viewed after startup at all, whereas the intent is to make it clear that you can't use "postgres -C" to view this parameter while

pgsql: Adjust documentation for configuring Linux huge pages.

2024-10-18 Thread Nathan Bossart
Adjust documentation for configuring Linux huge pages. The present wording about viewing shared_memory_size_in_huge_pages seems to suggest that the parameter cannot be viewed after startup at all, whereas the intent is to make it clear that you can't use "postgres -C" to view this parameter while

pgsql: Adjust documentation for configuring Linux huge pages.

2024-10-18 Thread Nathan Bossart
Adjust documentation for configuring Linux huge pages. The present wording about viewing shared_memory_size_in_huge_pages seems to suggest that the parameter cannot be viewed after startup at all, whereas the intent is to make it clear that you can't use "postgres -C" to view this parameter while

pgsql: Adjust documentation for configuring Linux huge pages.

2024-10-18 Thread Nathan Bossart
Adjust documentation for configuring Linux huge pages. The present wording about viewing shared_memory_size_in_huge_pages seems to suggest that the parameter cannot be viewed after startup at all, whereas the intent is to make it clear that you can't use "postgres -C" to view this parameter while

pgsql: Allow pg_set_relation_stats() to set relpages to -1.

2024-10-18 Thread Jeff Davis
Allow pg_set_relation_stats() to set relpages to -1. While the default value for relpages is 0, if a partitioned table with at least one child has been analyzed, then the partititoned table will have a relpages value of -1. Author: Corey Huinker Discussion: https://postgr.es/m/CADkLM=fajh1Lpcyr_

pgsql: Remove unused code for unlogged materialized views.

2024-10-18 Thread Fujii Masao
Remove unused code for unlogged materialized views. Commit 3bf3ab8c56 initially introduced support for unlogged materialized views, but this was later disallowed by commit 3223b25ff7. Additionally, commit d25f519107 added more code for handling unlogged materialized views. This commit cleans up al

pgsql: Fix memory leaks from incorrect strsep() uses

2024-10-18 Thread Peter Eisentraut
Fix memory leaks from incorrect strsep() uses Commit 5d2e1cc117b introduced some strsep() uses, but it did the memory management wrong in some cases. We need to keep a separate pointer to the allocate memory so that we can free it later, because strsep() advances the pointer we pass to it, and it

pgsql: Fix strsep() use for SCRAM secrets parsing

2024-10-18 Thread Peter Eisentraut
Fix strsep() use for SCRAM secrets parsing The previous code (from commit 5d2e1cc117b) did not detect end of string correctly, so it would fail to error out if fewer than the expected number of fields were present, which could then later lead to a crash when NULL string pointers are accessed. Rep