pgsql: Improve style of pg_lfind32().

2024-03-27 Thread Nathan Bossart
Improve style of pg_lfind32(). This commit simplifies pg_lfind32() a bit by moving the standard one-by-one linear search code to an inline helper function. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/20240327013616.GA3940109%40nathanxps13 Branch -- master Details ---

pgsql: Rethink create and attach APIs of shared TidStore.

2024-03-27 Thread Masahiko Sawada
Rethink create and attach APIs of shared TidStore. Previously, the behavior of TidStoreCreate() was inconsistent between local and shared TidStore instances in terms of memory limitation. For local TidStore, a memory context was created with initial and maximum memory block sizes, as well as a

pgsql: doc: fix CREATE ROLE typo

2024-03-27 Thread Bruce Momjian
doc: fix CREATE ROLE typo This wording typo was added in PG 16. Reported-by: s.bai...@chorusintel.com Discussion: https://postgr.es/m/171150077554.7105.801523271545956...@wrigleys.postgresql.org Backpatch-through: 16 Branch -- master Details ---

pgsql: doc: fix CREATE ROLE typo

2024-03-27 Thread Bruce Momjian
doc: fix CREATE ROLE typo This wording typo was added in PG 16. Reported-by: s.bai...@chorusintel.com Discussion: https://postgr.es/m/171150077554.7105.801523271545956...@wrigleys.postgresql.org Backpatch-through: 16 Branch -- REL_16_STABLE Details ---

pgsql: Run perltidy on generate-unicode_version.pl.

2024-03-27 Thread Jeff Davis
Run perltidy on generate-unicode_version.pl. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b0be28761ec5958bb7bbf9a03d94ee6e1bc59849 Modified Files -- src/common/unicode/generate-unicode_version.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

pgsql: Fix unnecessary use of moving-aggregate mode with non-moving fra

2024-03-27 Thread Tom Lane
Fix unnecessary use of moving-aggregate mode with non-moving frame. When a plain aggregate is used as a window function, and the window frame start is specified as UNBOUNDED PRECEDING, the frame's head cannot move so we do not need to use moving-aggregate mode. The check for that was put into

pgsql: Fix unnecessary use of moving-aggregate mode with non-moving fra

2024-03-27 Thread Tom Lane
Fix unnecessary use of moving-aggregate mode with non-moving frame. When a plain aggregate is used as a window function, and the window frame start is specified as UNBOUNDED PRECEDING, the frame's head cannot move so we do not need to use moving-aggregate mode. The check for that was put into

pgsql: Fix unnecessary use of moving-aggregate mode with non-moving fra

2024-03-27 Thread Tom Lane
Fix unnecessary use of moving-aggregate mode with non-moving frame. When a plain aggregate is used as a window function, and the window frame start is specified as UNBOUNDED PRECEDING, the frame's head cannot move so we do not need to use moving-aggregate mode. The check for that was put into

pgsql: Fix unnecessary use of moving-aggregate mode with non-moving fra

2024-03-27 Thread Tom Lane
Fix unnecessary use of moving-aggregate mode with non-moving frame. When a plain aggregate is used as a window function, and the window frame start is specified as UNBOUNDED PRECEDING, the frame's head cannot move so we do not need to use moving-aggregate mode. The check for that was put into

pgsql: Fix unnecessary use of moving-aggregate mode with non-moving fra

2024-03-27 Thread Tom Lane
Fix unnecessary use of moving-aggregate mode with non-moving frame. When a plain aggregate is used as a window function, and the window frame start is specified as UNBOUNDED PRECEDING, the frame's head cannot move so we do not need to use moving-aggregate mode. The check for that was put into

pgsql: Fix unnecessary use of moving-aggregate mode with non-moving fra

2024-03-27 Thread Tom Lane
Fix unnecessary use of moving-aggregate mode with non-moving frame. When a plain aggregate is used as a window function, and the window frame start is specified as UNBOUNDED PRECEDING, the frame's head cannot move so we do not need to use moving-aggregate mode. The check for that was put into

pgsql: Adjust documentation for syncfs().

2024-03-27 Thread Nathan Bossart
Adjust documentation for syncfs(). Commit 8c16ad3b43 created a new appendix for syncfs(), which is excessive for such a small amount of content. This commit moves the description of the caveats to be aware of when using syncfs() back to the documentation for recovery_init_sync_method. The

pgsql: Rename COMPAT_OPTIONS_CLIENT to COMPAT_OPTIONS_OTHER.

2024-03-27 Thread Robert Haas
Rename COMPAT_OPTIONS_CLIENT to COMPAT_OPTIONS_OTHER. The user-facing name is "Other Platforms and Clients", but the internal name seems too focused on clients specifically, especially given the plan to add a new setting to this session that is about platform or deployment model compatibility

pgsql: Fix unstable aggregate regression test

2024-03-27 Thread David Rowley
Fix unstable aggregate regression test Buildfarm member avocet has shown a plan change by switching the finalize aggregate stage to use a GroupAggregate rather than a HashAggregate. This is consistent with autovacuum having triggered on the table, per analysis by Alexander Lakhin. Fix this by

pgsql: Fix unstable aggregate regression test

2024-03-27 Thread David Rowley
Fix unstable aggregate regression test Buildfarm member avocet has shown a plan change by switching the finalize aggregate stage to use a GroupAggregate rather than a HashAggregate. This is consistent with autovacuum having triggered on the table, per analysis by Alexander Lakhin. Fix this by

pgsql: Add functions to generate random numbers in a specified range.

2024-03-27 Thread Dean Rasheed
Add functions to generate random numbers in a specified range. This adds 3 new variants of the random() function: random(min integer, max integer) returns integer random(min bigint, max bigint) returns bigint random(min numeric, max numeric) returns numeric Each returns a random

pgsql: Fix some typos and grammar issues from commit 87985cc92522

2024-03-27 Thread Alexander Korotkov
Fix some typos and grammar issues from commit 87985cc92522 Reported-by: Alexander Lakhin Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/818861eb578663a0d4d8d7dc4e18c96a148b3c75 Modified Files -- src/backend/access/heap/heapam.c | 2 +-

pgsql: Fix random failure in 004_subscription.

2024-03-27 Thread Amit Kapila
Fix random failure in 004_subscription. After the upgrade, the failed test was ensuring that the changes made on the publisher should be replicated to the subscriber. We missed waiting for one of the subscriptions to catch up. Per buildfarm Author: Vignesh C Reviewed-by: Kuroda Hayato