pgsql: Allow some exclusion constraints on partitions

2023-07-12 Thread Peter Eisentraut
Allow some exclusion constraints on partitions Previously we only allowed unique B-tree constraints on partitions (and only if the constraint included all the partition keys). But we could allow exclusion constraints with the same restriction. We also require that those columns be compared for e

pgsql: Remove ancient special case code for dropping oid columns

2023-07-12 Thread Peter Eisentraut
Remove ancient special case code for dropping oid columns The special handling of negative attribute numbers in RemoveAttributeById() was introduced to support SET WITHOUT OIDS (commit 24614a9880). But that feature doesn't exist anymore, so we can revert to the previous, simpler version. Reviewe

pgsql: Remove ancient special case code for adding oid columns

2023-07-12 Thread Peter Eisentraut
Remove ancient special case code for adding oid columns The special handling of negative attribute numbers in ATExecAddColumn() was introduced to support SET WITH OIDS (commit 6d1e361852). But that feature doesn't exist anymore, so we can revert to the previous, simpler version. In passing, also

pgsql: Remove obsolete comment about OID support

2023-07-12 Thread Peter Eisentraut
Remove obsolete comment about OID support Reviewed-by: Alvaro Herrera Discussion: https://www.postgresql.org/message-id/flat/52a125e4-ff9a-95f5-9f61-b87cf447e...@eisentraut.org Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/adf333b4edb24fc9134fd76cd6c2d65f9a89c3a

pgsql: parallel_schedule: add comment on event_trigger test dependency

2023-07-12 Thread Alvaro Herrera
parallel_schedule: add comment on event_trigger test dependency This is cosmetic, so no backpatch. Discussion: https://postgr.es/m/20230405233356.qs4w4jtfc3kq4obl@alvherre.pgsql Author: Álvaro Herrera Reviewed-by: Peter Eisentraut Branch -- master Details --- https://git.postgresql.or

pgsql: doc: Clarify the errhint example

2023-07-12 Thread Daniel Gustafsson
doc: Clarify the errhint example The errhint example wasn't using the mandated style for errhint which was needlessly confusing. Fix by rewriting it using the mandated style. Reported-by: Andres Freund Reviewed-by: Gurjeet Singh Reviewed-by: Jonathan S. Katz Discussion: https://postgr.es/m/f0

pgsql: meson: Tie adding C++ support to the llvm Meson option

2023-07-12 Thread Andres Freund
meson: Tie adding C++ support to the llvm Meson option In the event the llvm option is defined to be 'auto', it is possible that the host machine might not have a C++ compiler. If that is the case, then we shouldn't continue reaching for the llvm dependency. To make it easier to understand the ca

pgsql: pg_bsd_indent: Collect test diffs in test.diffs instead of tests

2023-07-12 Thread Andres Freund
pg_bsd_indent: Collect test diffs in test.diffs instead of tests.diff That way CI knows to pick up the file if the test fails. Discussion: https://postgr.es/m/20230711233307.hu4wetabjm5f7...@awork3.anarazel.de Backpatch: 16-, where the test was added Branch -- REL_16_STABLE Details ---

pgsql: meson: Pass more feature option through to required kwargs

2023-07-12 Thread Andres Freund
meson: Pass more feature option through to required kwargs That was already done in a lot of places, but not all. Backpatch this to keep the the meson files aligned as long as reasonably possible. Author: Tristan Partin Reviewed-by: Andres Freund Discussion: https://postgr.es/m/CSPIJVUDZFKX.3K

pgsql: meson: Pass more feature option through to required kwargs

2023-07-12 Thread Andres Freund
meson: Pass more feature option through to required kwargs That was already done in a lot of places, but not all. Backpatch this to keep the the meson files aligned as long as reasonably possible. Author: Tristan Partin Reviewed-by: Andres Freund Discussion: https://postgr.es/m/CSPIJVUDZFKX.3K

pgsql: pg_bsd_indent: Collect test diffs in test.diffs instead of tests

2023-07-12 Thread Andres Freund
pg_bsd_indent: Collect test diffs in test.diffs instead of tests.diff That way CI knows to pick up the file if the test fails. Discussion: https://postgr.es/m/20230711233307.hu4wetabjm5f7...@awork3.anarazel.de Backpatch: 16-, where the test was added Branch -- master Details --- https:

pgsql: meson: Tie adding C++ support to the llvm Meson option

2023-07-12 Thread Andres Freund
meson: Tie adding C++ support to the llvm Meson option In the event the llvm option is defined to be 'auto', it is possible that the host machine might not have a C++ compiler. If that is the case, then we shouldn't continue reaching for the llvm dependency. To make it easier to understand the ca

Re: pgsql: Integrate pg_bsd_indent into our build/test infrastructure.

2023-07-12 Thread Andres Freund
Hi, On 2023-07-11 22:21:38 -0400, Tom Lane wrote: > Andres Freund writes: > > And subsequently noticed that CI currently doesn't collect the tests.diff > > file, so I don't know why that failed. CI currently collects all *.diffs > > files, I don't really want it to also collect all .diff files, s

pgsql: Simplify some conditions related to [LW]Lock in generate-wait_ev

2023-07-12 Thread Michael Paquier
Simplify some conditions related to [LW]Lock in generate-wait_event_types.pl The first check on the enum values was not necessary as the values set in wait_event_names.txt for the classes LWLock and Lock were able to satisfy the check. The second check when generating the C and header files is no

pgsql: Pass constructName to transformJsonValueExpr()

2023-07-12 Thread Amit Langote
Pass constructName to transformJsonValueExpr() This allows it to pass to coerce_to_specific_type() the actual name corresponding to the specific JSON_* function expression being transformed, instead of the currently hardcoded string. Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/C

pgsql: Don't include CaseTestExpr in JsonValueExpr.formatted_expr

2023-07-12 Thread Amit Langote
Don't include CaseTestExpr in JsonValueExpr.formatted_expr A CaseTestExpr is currently being put into JsonValueExpr.formatted_expr as placeholder for the result of evaluating JsonValueExpr.raw_expr, which in turn is evaluated separately. Though, there's no need for this indirection if raw_expr it

pgsql: Teach in-tree getopt_long() to move non-options to the end of ar

2023-07-12 Thread Nathan Bossart
Teach in-tree getopt_long() to move non-options to the end of argv. Unlike the other implementations of getopt_long() I could find, the in-tree implementation does not reorder non-options to the end of argv. Instead, it returns -1 as soon as the first non-option is found, even if there are other

Re: pgsql: Pass constructName to transformJsonValueExpr()

2023-07-12 Thread Tom Lane
Amit Langote writes: > Pass constructName to transformJsonValueExpr() Surely "char *constructName" should be "const char *constructName"? regards, tom lane

pgsql: Rename session_auth_is_superuser to current_role_is_superuser.

2023-07-12 Thread Nathan Bossart
Rename session_auth_is_superuser to current_role_is_superuser. This variable might've been accurately named when it was added in ea886339b8, but the name hasn't been accurate since at least the introduction of SET ROLE in e5d6b91220. The corresponding documentation was fixed in eedb068c0a. This

pgsql: Doc: clarify the conditions of usable indexes for REPLICA IDENTI

2023-07-12 Thread Masahiko Sawada
Doc: clarify the conditions of usable indexes for REPLICA IDENTITY FULL tables. Commit 89e46da5e allowed REPLICA IDENTITY FULL tables to use an index on the subscriber during apply of update/delete. This commit clarifies in the documentation that the leftmost field of candidate indexes must be a c

pgsql: Doc: clarify the conditions of usable indexes for REPLICA IDENTI

2023-07-12 Thread Masahiko Sawada
Doc: clarify the conditions of usable indexes for REPLICA IDENTITY FULL tables. Commit 89e46da5e allowed REPLICA IDENTITY FULL tables to use an index on the subscriber during apply of update/delete. This commit clarifies in the documentation that the leftmost field of candidate indexes must be a c