pgsql: Harmonize parameter names in storage and AM code.

2022-09-19 Thread Peter Geoghegan
Harmonize parameter names in storage and AM code. Make sure that function declarations use names that exactly match the corresponding names from function definitions in storage, catalog, access method, executor, and logical replication code, as well as in miscellaneous utility/library code. Like

pgsql: Split TESTDIR into TESTLOGDIR and TESTDATADIR

2022-09-19 Thread Andres Freund
Split TESTDIR into TESTLOGDIR and TESTDATADIR The motivation for this is twofold. For one the meson patchset would like to have more control over the logfiles. For another, the log file location for tap tests (tmp_check/log) is not symmetric to the log location for pg_regress/isolation tests (log/

pgsql: Don't hardcode tmp_check/ as test directory for tap tests

2022-09-19 Thread Andres Freund
Don't hardcode tmp_check/ as test directory for tap tests This is motivated by the meson patchset, which wants to put the log / data for tests in a different place than the autoconf build. Right now log files for tap tests have to be inside $TESTDIR/tmp_check, whereas log files for pg_regress/isol

Re: pgsql: Fix createdb tests for C locale

2022-09-19 Thread Andres Freund
Hi, On 2022-09-19 15:46:04 -0400, Peter Eisentraut wrote: > On 17.09.22 16:44, Tom Lane wrote: > > Christoph Berg writes: > > > This seems to have broken 15 on apt.pg.o/Debian: > > > > Fails on RHEL8 too, if LANG=C. > > OK if LANG=C.utf8. > > > > (The lack of buildfarm complaints is distressing

pgsql: Harmonize heapam and tableam parameter names.

2022-09-19 Thread Peter Geoghegan
Harmonize heapam and tableam parameter names. Make sure that function declarations use names that exactly match the corresponding names from function definitions. Having parameter names that are reliably consistent in this way will make it easier to reason about groups of related C functions from

pgsql: Consistently use named parameters in regex code consistently.

2022-09-19 Thread Peter Geoghegan
Consistently use named parameters in regex code consistently. Adjust a handful of remaining function prototypes that were overlooked by recent commit bc2187ed. This oversight wasn't caught by clang-tidy because the functions in question are only built in custom REG_DEBUG builds. Author: Peter Ge

pgsql: Extend gendef.pl in preparation for meson

2022-09-19 Thread Andres Freund
Extend gendef.pl in preparation for meson The main issue with using gendef.pl as-is for meson is that with meson the filenames are a bit longer, exceeding the max commandline length when calling dumpbin with all objects. As it's easier to pass in a library anyway, do so. The .def file location, i

Re: pgsql: Add support for MERGE SQL command

2022-09-19 Thread Tom Lane
I wrote: > It might be better to change these to temp tables. You'd then > have to filter the temp schema out of the results; but since you > have a filtering function anyway, that doesn't seem too hard. Or even easier, ALTER TABLE SET autovacuum_enabled = 'false' before populating them.

pgsql: Update Unicode data to Unicode 15.0.0

2022-09-19 Thread Peter Eisentraut
Update Unicode data to Unicode 15.0.0 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1091b48cd761abc7f697fa9c4e018c46763b46fb Modified Files -- src/Makefile.global.in |2 +- src/include/common/unicode_east_asian_fw_table.h |

Re: pgsql: Consistently use named parameters in regex code.

2022-09-19 Thread Peter Geoghegan
On Mon, Sep 19, 2022 at 3:18 PM Tom Lane wrote: > Just scanning this quickly, it looks like you missed the ones > hidden behind #ifdef REG_DEBUG, eg dumpstate(). Ugh, yeah. I did manage to catch some of them -- but not all of them. Will address this with a follow-up commit shortly. -- Peter Ge

Re: pgsql: Consistently use named parameters in regex code.

2022-09-19 Thread Tom Lane
Peter Geoghegan writes: > Consistently use named parameters in regex code. Just scanning this quickly, it looks like you missed the ones hidden behind #ifdef REG_DEBUG, eg dumpstate(). regards, tom lane

pgsql: Consistently use named parameters in timezone code.

2022-09-19 Thread Peter Geoghegan
Consistently use named parameters in timezone code. Make our copy of the IANA timezone library use named parameters in function declarations. Also make sure that parameter names from each function's declaration match corresponding definition parameter names. This makes the timezone code follow P

Re: pgsql: Add support for MERGE SQL command

2022-09-19 Thread Tom Lane
Alvaro Herrera writes: > Add support for MERGE SQL command komodoensis just failed in a way that demonstrates instability of the MERGE tests [1]. It looks to me like a background autovacuum came along and processed one or both of ex_msource and ex_mtarget, causing their default join plan to chan

pgsql: Consistently use named parameters in regex code.

2022-09-19 Thread Peter Geoghegan
Consistently use named parameters in regex code. Make regex code consistently use named parameters in function declarations. Also make sure that parameter names from each function's declaration match corresponding definition parameter names. This makes Henry Spencer's regex code follow Postgres

pgsql: Fix misleading comment for get_cheapest_group_keys_order

2022-09-19 Thread David Rowley
Fix misleading comment for get_cheapest_group_keys_order The header comment for get_cheapest_group_keys_order() claimed that the output arguments were set to a newly allocated list which may be freed by the calling function, however, this was not always true as the function would simply leave thes

pgsql: Fix misleading comment for get_cheapest_group_keys_order

2022-09-19 Thread David Rowley
Fix misleading comment for get_cheapest_group_keys_order The header comment for get_cheapest_group_keys_order() claimed that the output arguments were set to a newly allocated list which may be freed by the calling function, however, this was not always true as the function would simply leave thes

pgsql: Fix out-dated comment in preprocess_groupclause()

2022-09-19 Thread David Rowley
Fix out-dated comment in preprocess_groupclause() The comment claimed we don't consider other orders of the GROUP BY clause, but this is no longer true as of db0d67db2. Discussion: https://postgr.es/m/CAApHDvq65=9ro+hlx1i9ugweindvhrbibao7arctnf38_je...@mail.gmail.com Backpatch-through: 15, where

pgsql: Fix out-dated comment in preprocess_groupclause()

2022-09-19 Thread David Rowley
Fix out-dated comment in preprocess_groupclause() The comment claimed we don't consider other orders of the GROUP BY clause, but this is no longer true as of db0d67db2. Discussion: https://postgr.es/m/CAApHDvq65=9ro+hlx1i9ugweindvhrbibao7arctnf38_je...@mail.gmail.com Backpatch-through: 15, where

pgsql: Remove various duplicated words

2022-09-19 Thread David Rowley
Remove various duplicated words Author: Justin Pryzby Discussion: https://postgr.es/m/20220919111000.gw31...@telsasoft.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/66fa8ff637982b51257d80626dd00dccf3ad9fa6 Modified Files -- src/backend/executor/ex

Re: pgsql: Fix createdb tests for C locale

2022-09-19 Thread Peter Eisentraut
On 17.09.22 16:44, Tom Lane wrote: Christoph Berg writes: This seems to have broken 15 on apt.pg.o/Debian: Fails on RHEL8 too, if LANG=C. OK if LANG=C.utf8. (The lack of buildfarm complaints is distressing. Apparently our coverage of ICU is very thin.) This issue is with a combination of

Re: pgsql: Fix createdb tests for C locale

2022-09-19 Thread Peter Eisentraut
On 17.09.22 12:15, Christoph Berg wrote: Re: Peter Eisentraut Fix createdb tests for C locale If the createdb tests run under the C locale, the database cluster will be initialized with encoding SQL_ASCII. With the checks added in c7db01e325a530ec38ec7ba57cd3ed32e123e33c, this will cause sever

pgsql: Fix icu tests with C locale

2022-09-19 Thread Peter Eisentraut
Fix icu tests with C locale Similar to 1e08576691bf1a25c0e28745e5e800c44f2a1c76, but for the icu test suite. Reported-by: Christoph Berg Discussion: https://www.postgresql.org/message-id/yyweu61ymfwjv...@msg.df7cb.de Branch -- master Details --- https://git.postgresql.org/pg/commitdiff

pgsql: Fix icu tests with C locale

2022-09-19 Thread Peter Eisentraut
Fix icu tests with C locale Similar to 1e08576691bf1a25c0e28745e5e800c44f2a1c76, but for the icu test suite. Reported-by: Christoph Berg Discussion: https://www.postgresql.org/message-id/yyweu61ymfwjv...@msg.df7cb.de Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/com

pgsql: Make ALTER DEFAULT PRIVILEGES require privileges, not membership

2022-09-19 Thread Robert Haas
Make ALTER DEFAULT PRIVILEGES require privileges, not membership. If role A is a direct or indirect member of role B but does not inherit B's privileges (because at least one relevant grant was created WITH INHERIT FALSE) then A should not be permitted to bypass privilege checks that require the p

pgsql: walmethods.c/h: Make WalWriteMethod more object-oriented.

2022-09-19 Thread Robert Haas
walmethods.c/h: Make WalWriteMethod more object-oriented. Normally when we use object-oriented programming techniques, we provide a pointer to an object and then some way of looking up the associated table of callbacks, but walmethods.c/h took the alternative approach of providing only a pointer t

pgsql: Future-proof the recursion inside ExecShutdownNode().

2022-09-19 Thread Tom Lane
Future-proof the recursion inside ExecShutdownNode(). The API contract for planstate_tree_walker() callbacks is that they take a PlanState pointer and a context pointer. Somebody figured they could save a couple lines of code by ignoring that, and passing ExecShutdownNode itself as the walker eve

pgsql: Future-proof the recursion inside ExecShutdownNode().

2022-09-19 Thread Tom Lane
Future-proof the recursion inside ExecShutdownNode(). The API contract for planstate_tree_walker() callbacks is that they take a PlanState pointer and a context pointer. Somebody figured they could save a couple lines of code by ignoring that, and passing ExecShutdownNode itself as the walker eve

pgsql: Future-proof the recursion inside ExecShutdownNode().

2022-09-19 Thread Tom Lane
Future-proof the recursion inside ExecShutdownNode(). The API contract for planstate_tree_walker() callbacks is that they take a PlanState pointer and a context pointer. Somebody figured they could save a couple lines of code by ignoring that, and passing ExecShutdownNode itself as the walker eve

pgsql: Future-proof the recursion inside ExecShutdownNode().

2022-09-19 Thread Tom Lane
Future-proof the recursion inside ExecShutdownNode(). The API contract for planstate_tree_walker() callbacks is that they take a PlanState pointer and a context pointer. Somebody figured they could save a couple lines of code by ignoring that, and passing ExecShutdownNode itself as the walker eve

pgsql: Future-proof the recursion inside ExecShutdownNode().

2022-09-19 Thread Tom Lane
Future-proof the recursion inside ExecShutdownNode(). The API contract for planstate_tree_walker() callbacks is that they take a PlanState pointer and a context pointer. Somebody figured they could save a couple lines of code by ignoring that, and passing ExecShutdownNode itself as the walker eve

pgsql: Future-proof the recursion inside ExecShutdownNode().

2022-09-19 Thread Tom Lane
Future-proof the recursion inside ExecShutdownNode(). The API contract for planstate_tree_walker() callbacks is that they take a PlanState pointer and a context pointer. Somebody figured they could save a couple lines of code by ignoring that, and passing ExecShutdownNode itself as the walker eve

pgsql: Future-proof the recursion inside ExecShutdownNode().

2022-09-19 Thread Tom Lane
Future-proof the recursion inside ExecShutdownNode(). The API contract for planstate_tree_walker() callbacks is that they take a PlanState pointer and a context pointer. Somebody figured they could save a couple lines of code by ignoring that, and passing ExecShutdownNode itself as the walker eve

pgsql: walmethods.c/h: Make Walfile a struct, rather than a void *

2022-09-19 Thread Robert Haas
walmethods.c/h: Make Walfile a struct, rather than a void * This makes the curent file position and pathname visible in a generic way, so we no longer need current_walfile_name global variable or the get_current_pos() method. Since that purported to be able to fail but never actually did, this als

pgsql: Improve GUC description punctuation

2022-09-19 Thread Peter Eisentraut
Improve GUC description punctuation partial backpatch of 0b039e3a8489c08ec61b4d40382047c389af91ad Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/e4861b2322b74619a1124cd72d4987be0f2815e8 Modified Files -- src/backend/utils/misc/guc.c | 4 ++-- 1 f

pgsql: Add missing serial commas

2022-09-19 Thread Peter Eisentraut
Add missing serial commas Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/cacf12e92f7854547b8125f8a9d58694a05d1479 Modified Files -- doc/src/sgml/ref/pgbench.sgml | 2 +- src/bin/pgbench/pgbench.c | 2 +- 2 files changed, 2 insertions(+), 2 dele

pgsql: Add missing serial commas

2022-09-19 Thread Peter Eisentraut
Add missing serial commas Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1fe1d09652d796392785922bef54e0ffda6e1f05 Modified Files -- doc/src/sgml/ref/pgbench.sgml | 2 +- src/bin/pgbench/pgbench.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-

pgsql: Fix typos.

2022-09-19 Thread Amit Kapila
Fix typos. Author: Hou Zhijie and Zhang Mingli Discussion: https://postgr.es/m/os0pr01mb57162559c01fe2848c12e8f794...@os0pr01mb5716.jpnprd01.prod.outlook.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a23417790631e50f54bdcf5e40bf84e2dbd1c34b Modified Files --