Re: pgsql: Disable run condition optimization for some WindowFuncs

2024-04-30 Thread Tom Lane
David Rowley writes: > On Wed, 1 May 2024 at 17:02, Tatsuo Ishii wrote: >> Maybe you are talking about BUG #18305: > Thanks for pointing it out. There's not much I can do to correct the > commit message now. Yeah, once pushed commit messages are pretty much graven on stone tablets. But we do

Re: pgsql: Disable run condition optimization for some WindowFuncs

2024-04-30 Thread David Rowley
On Wed, 1 May 2024 at 17:02, Tatsuo Ishii wrote: > > Bug: #18170 > > Maybe you are talking about BUG #18305: > Unexpected error: "WindowFunc not found in subplan target lists" ? Unsure what happened there, but yes, you're right. That should be #18305 and [1]. I believe I just copied and pasted

pgsql: Fix typos and incorrect type in read_stream.c

2024-04-30 Thread David Rowley
Fix typos and incorrect type in read_stream.c max_ios should be int rather than int16, otherwise there's not much point in doing: max_ios = Min(max_ios, PG_INT16_MAX); Discussion: https://postgr.es/m/caaphdvr9un-xpdr_+afdogm38o2k8spfohimqz838ggutgy...@mail.gmail.com Branch -- master

Re: pgsql: Disable run condition optimization for some WindowFuncs

2024-04-30 Thread Tatsuo Ishii
> Disable run condition optimization for some WindowFuncs > > 94985c210 added code to detect when WindowFuncs were monotonic and > allowed additional quals to be "pushed down" into the subquery to be > used as WindowClause runConditions in order to short-circuit execution > in nodeWindowAgg.c. >

pgsql: Disable run condition optimization for some WindowFuncs

2024-04-30 Thread David Rowley
Disable run condition optimization for some WindowFuncs 94985c210 added code to detect when WindowFuncs were monotonic and allowed additional quals to be "pushed down" into the subquery to be used as WindowClause runConditions in order to short-circuit execution in nodeWindowAgg.c. The Node

pgsql: Disable run condition optimization for some WindowFuncs

2024-04-30 Thread David Rowley
Disable run condition optimization for some WindowFuncs 94985c210 added code to detect when WindowFuncs were monotonic and allowed additional quals to be "pushed down" into the subquery to be used as WindowClause runConditions in order to short-circuit execution in nodeWindowAgg.c. The Node

pgsql: Fix parallel vacuum buffer usage reporting.

2024-04-30 Thread Masahiko Sawada
Fix parallel vacuum buffer usage reporting. A parallel worker's buffer usage is accumulated to its pgBufferUsage and then is accumulated into the leader's one at the end of the parallel vacuum. However, since the leader process used to use dedicated VacuumPage{Hit, Miss, Dirty} globals for the

pgsql: Fix parallel vacuum buffer usage reporting.

2024-04-30 Thread Masahiko Sawada
Fix parallel vacuum buffer usage reporting. A parallel worker's buffer usage is accumulated to its pgBufferUsage and then is accumulated into the leader's one at the end of the parallel vacuum. However, since the leader process used to use dedicated VacuumPage{Hit, Miss, Dirty} globals for the

pgsql: Fix parallel vacuum buffer usage reporting.

2024-04-30 Thread Masahiko Sawada
Fix parallel vacuum buffer usage reporting. A parallel worker's buffer usage is accumulated to its pgBufferUsage and then is accumulated into the leader's one at the end of the parallel vacuum. However, since the leader process used to use dedicated VacuumPage{Hit, Miss, Dirty} globals for the

pgsql: Add tab completion for EXPLAIN (MEMORY|SERIALIZE)

2024-04-30 Thread Michael Paquier
Add tab completion for EXPLAIN (MEMORY|SERIALIZE) SERIALIZE has been added in 06286709ee06, and MEMORY in 5de890e3610d. Author: Jian He Discussion: https://postgr.es/m/cacjufxh5ubhbcg-omt7phomvnabf2x48jfefu24fexsqvgz...@mail.gmail.com Branch -- master Details ---

Re: pgsql: Introduce "builtin" collation provider.

2024-04-30 Thread Jeff Davis
On Tue, 2024-04-23 at 11:23 +0200, Peter Eisentraut wrote: > I think I found a small bug in this commit. Good catch, thank you. Committed a fix. Regards, Jeff Davis

pgsql: Ensure we allocate NAMEDATALEN bytes for names in Index Only Sca

2024-04-30 Thread David Rowley
Ensure we allocate NAMEDATALEN bytes for names in Index Only Scans As an optimization, we store "name" columns as cstrings in btree indexes. Here we modify it so that Index Only Scans convert these cstrings back to names with NAMEDATALEN bytes rather than storing the cstring in the tuple slot,

pgsql: Ensure we allocate NAMEDATALEN bytes for names in Index Only Sca

2024-04-30 Thread David Rowley
Ensure we allocate NAMEDATALEN bytes for names in Index Only Scans As an optimization, we store "name" columns as cstrings in btree indexes. Here we modify it so that Index Only Scans convert these cstrings back to names with NAMEDATALEN bytes rather than storing the cstring in the tuple slot,

pgsql: Ensure we allocate NAMEDATALEN bytes for names in Index Only Sca

2024-04-30 Thread David Rowley
Ensure we allocate NAMEDATALEN bytes for names in Index Only Scans As an optimization, we store "name" columns as cstrings in btree indexes. Here we modify it so that Index Only Scans convert these cstrings back to names with NAMEDATALEN bytes rather than storing the cstring in the tuple slot,

pgsql: Ensure we allocate NAMEDATALEN bytes for names in Index Only Sca

2024-04-30 Thread David Rowley
Ensure we allocate NAMEDATALEN bytes for names in Index Only Scans As an optimization, we store "name" columns as cstrings in btree indexes. Here we modify it so that Index Only Scans convert these cstrings back to names with NAMEDATALEN bytes rather than storing the cstring in the tuple slot,

pgsql: Ensure we allocate NAMEDATALEN bytes for names in Index Only Sca

2024-04-30 Thread David Rowley
Ensure we allocate NAMEDATALEN bytes for names in Index Only Scans As an optimization, we store "name" columns as cstrings in btree indexes. Here we modify it so that Index Only Scans convert these cstrings back to names with NAMEDATALEN bytes rather than storing the cstring in the tuple slot,

pgsql: Ensure we allocate NAMEDATALEN bytes for names in Index Only Sca

2024-04-30 Thread David Rowley
Ensure we allocate NAMEDATALEN bytes for names in Index Only Scans As an optimization, we store "name" columns as cstrings in btree indexes. Here we modify it so that Index Only Scans convert these cstrings back to names with NAMEDATALEN bytes rather than storing the cstring in the tuple slot,

pgsql: Fix locale options checking in CREATE DATABASE.

2024-04-30 Thread Jeff Davis
Fix locale options checking in CREATE DATABASE. Discussion: https://postgr.es/m/4ea13583-7305-40b0-8525-58381533e...@eisentraut.org Reported-by: Peter Eisentraut Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/7562a9bd7100702ce7878a17f4aaac1df08a8e09 Modified

pgsql: Disallow converting a table to a view within an outer SQL comman

2024-04-30 Thread Tom Lane
Disallow converting a table to a view within an outer SQL command. We have long disallowed all forms of ALTER TABLE if the table is already opened by some outer SQL command in the same session. This has the same purpose as obtaining AccessExclusiveLock, but since a session's own locks don't

pgsql: Disallow converting a table to a view within an outer SQL comman

2024-04-30 Thread Tom Lane
Disallow converting a table to a view within an outer SQL command. We have long disallowed all forms of ALTER TABLE if the table is already opened by some outer SQL command in the same session. This has the same purpose as obtaining AccessExclusiveLock, but since a session's own locks don't

pgsql: Disallow converting a table to a view within an outer SQL comman

2024-04-30 Thread Tom Lane
Disallow converting a table to a view within an outer SQL command. We have long disallowed all forms of ALTER TABLE if the table is already opened by some outer SQL command in the same session. This has the same purpose as obtaining AccessExclusiveLock, but since a session's own locks don't

pgsql: Disallow converting a table to a view within an outer SQL comman

2024-04-30 Thread Tom Lane
Disallow converting a table to a view within an outer SQL command. We have long disallowed all forms of ALTER TABLE if the table is already opened by some outer SQL command in the same session. This has the same purpose as obtaining AccessExclusiveLock, but since a session's own locks don't

pgsql: Fix one more portability shortcoming in new test_pg_dump test.

2024-04-30 Thread Tom Lane
Fix one more portability shortcoming in new test_pg_dump test. If the bootstrap superuser's name requires quoting, regroleout will supply double quotes ... but the result of CURRENT_USER is just the literal name. Apply quote_ident() to ensure a match. Per Andrew Dunstan's off-list investigation

pgsql: doc: Remove one example related to pg_input_error_info()

2024-04-30 Thread Michael Paquier
doc: Remove one example related to pg_input_error_info() This slightly bloated the contents of the function table for this entry, without really bringing extra value. Per discussion with Jian He and David G. Johnston. Discussion:

pgsql: Stabilize regression tests introduced by 259c96fa8f

2024-04-30 Thread Alexander Korotkov
Stabilize regression tests introduced by 259c96fa8f Add the ORDER BY clause to new queries to avoid ordering ambiguity. Per buildfarm member rorqual. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/449cdcd486bfc6864e4fa6784cc1526a94fe69db Modified Files

pgsql: Inherit parent's AM for partition MERGE/SPLIT operations

2024-04-30 Thread Alexander Korotkov
Inherit parent's AM for partition MERGE/SPLIT operations This commit makes new partitions created by ALTER TABLE ... SPLIT PARTITION and ALTER TABLE ... MERGE PARTITIONS commands inherit the paret table access method. Reported-by: Alexander Lakhin Discussion:

pgsql: Change the way ATExecMergePartitions() handles the name collisio

2024-04-30 Thread Alexander Korotkov
Change the way ATExecMergePartitions() handles the name collision The name collision happens when the name of the new partition is the same as the name of one of the merging partitions. Currently, ATExecMergePartitions() first gives the new partition a temporary name and then renames it when old

pgsql: Add tab completion for partition MERGE/SPLIT operations

2024-04-30 Thread Alexander Korotkov
Add tab completion for partition MERGE/SPLIT operations This commit implements psql tab completion for ALTER TABLE ... SPLIT PARTITION and ALTER TABLE ... MERGE PARTITIONS commands. Reported-by: Alexander Lakhin Discussion: https://postgr.es/m/5dee3937-8e9f-cca4-11fb-737709a92b37%40gmail.com

pgsql: Document the way partition MERGE/SPLIT operations create new par

2024-04-30 Thread Alexander Korotkov
Document the way partition MERGE/SPLIT operations create new partitions Reported-by: Justin Pryzby Discussion: https://postgr.es/m/ZilrByTp-pbz6Mvf%40pryzbyj2023 Reviewed-by: Justin Pryzby Branch -- master Details ---

pgsql: Rename tables in tests of partition MERGE/SPLIT operations

2024-04-30 Thread Alexander Korotkov
Rename tables in tests of partition MERGE/SPLIT operations Replace "salesman" with "salesperson", "salesmen" with "salespeople". The names are both gramatically correct and gender-neutral. Reported-by: Alexander Lakhin Discussion:

pgsql: Fix error message in check_partition_bounds_for_split_range()

2024-04-30 Thread Alexander Korotkov
Fix error message in check_partition_bounds_for_split_range() Currently, the error message is produced by a system of complex substitutions making it quite untranslatable and hard to read. This commit splits this into 4 plain error messages suitable for translation. Reported-by: Kyotaro

pgsql: Make new partitions with parent's persistence during MERGE/SPLIT

2024-04-30 Thread Alexander Korotkov
Make new partitions with parent's persistence during MERGE/SPLIT The createPartitionTable() function is responsible for creating new partitions for ALTER TABLE ... MERGE PARTITIONS, and ALTER TABLE ... SPLIT PARTITION commands. It emulates the behaviour of CREATE TABLE ... (LIKE ...), where new