pgsql: Skip not SOAP-supported indexes while transforming an OR clause

2024-11-28 Thread Alexander Korotkov
Skip not SOAP-supported indexes while transforming an OR clause into SAOP There is no point in transforming OR-clauses into SAOP's if the target index doesn't support SAOP scans anyway. This commit adds corresponding checks to match_orclause_to_indexcol() and group_similar_or_args(). The first c

pgsql: Add tests for foreign keys with case-insensitive collations

2024-11-28 Thread Peter Eisentraut
Add tests for foreign keys with case-insensitive collations Some of the behaviors of the different referential actions, such as the difference between NO ACTION and RESTRICT are best illustrated using a case-insensitive collation. So add some tests for that. (What is actually being tested here i

pgsql: doc: Improve description of referential actions

2024-11-28 Thread Peter Eisentraut
doc: Improve description of referential actions Some of the differences between NO ACTION and RESTRICT were not explained fully. Discussion: https://www.postgresql.org/message-id/ea5b2777-266a-46fa-852f-6fca6ec48...@eisentraut.org Branch -- master Details --- https://git.postgresql.org

pgsql: psql: Add tab completion for COPY (MERGE ...

2024-11-28 Thread Peter Eisentraut
psql: Add tab completion for COPY (MERGE ... The underlying feature for this was added in PostgreSQL 17. Author: Jian He Discussion: https://www.postgresql.org/message-id/cacjufxemnjxvf1der1zbrjbjameclrzz+yaabuqdkh_...@mail.gmail.com Branch -- REL_17_STABLE Details --- https://git

pgsql: psql: Add tab completion for COPY (MERGE ...

2024-11-28 Thread Peter Eisentraut
psql: Add tab completion for COPY (MERGE ... The underlying feature for this was added in PostgreSQL 17. Author: Jian He Discussion: https://www.postgresql.org/message-id/cacjufxemnjxvf1der1zbrjbjameclrzz+yaabuqdkh_...@mail.gmail.com Branch -- master Details --- https://git.postgr

pgsql: Remove useless casts to (void *)

2024-11-28 Thread Peter Eisentraut
Remove useless casts to (void *) Many of them just seem to have been copied around for no real reason. Their presence causes (small) risks of hiding actual type mismatches or silently discarding qualifiers Discussion: https://www.postgresql.org/message-id/flat/461ea37c-8b58-43b4-9736-52884e862..

pgsql: Fix MinGW %d vs %lu warnings in back branches.

2024-11-28 Thread Thomas Munro
Fix MinGW %d vs %lu warnings in back branches. Commit 352f6f2d used %d instead of %lu to format DWORD (unsigned long) with psprintf(). The _WIN32_WINNT value recently changed for MinGW in REL_15_STABLE (commit d700e8d7), so the code was suddenly being compiled, with warnings from gcc. The warnin

pgsql: Fix MinGW %d vs %lu warnings in back branches.

2024-11-28 Thread Thomas Munro
Fix MinGW %d vs %lu warnings in back branches. Commit 352f6f2d used %d instead of %lu to format DWORD (unsigned long) with psprintf(). The _WIN32_WINNT value recently changed for MinGW in REL_15_STABLE (commit d700e8d7), so the code was suddenly being compiled, with warnings from gcc. The warnin

pgsql: Fix MinGW %d vs %lu warnings in back branches.

2024-11-28 Thread Thomas Munro
Fix MinGW %d vs %lu warnings in back branches. Commit 352f6f2d used %d instead of %lu to format DWORD (unsigned long) with psprintf(). The _WIN32_WINNT value recently changed for MinGW in REL_15_STABLE (commit d700e8d7), so the code was suddenly being compiled, with warnings from gcc. The warnin

pgsql: Avoid mislabeling of lateral references when pulling up a subque

2024-11-28 Thread Tom Lane
Avoid mislabeling of lateral references when pulling up a subquery. If we are pulling up a subquery that's under an outer join, and the subquery's target list contains a strict expression that uses both a subquery variable and a lateral-reference variable, it's okay to pull up the expression witho

pgsql: Avoid mislabeling of lateral references when pulling up a subque

2024-11-28 Thread Tom Lane
Avoid mislabeling of lateral references when pulling up a subquery. If we are pulling up a subquery that's under an outer join, and the subquery's target list contains a strict expression that uses both a subquery variable and a lateral-reference variable, it's okay to pull up the expression witho

pgsql: Avoid mislabeling of lateral references when pulling up a subque

2024-11-28 Thread Tom Lane
Avoid mislabeling of lateral references when pulling up a subquery. If we are pulling up a subquery that's under an outer join, and the subquery's target list contains a strict expression that uses both a subquery variable and a lateral-reference variable, it's okay to pull up the expression witho

pgsql: psql: Sprinkle more CppAsString2() in describe.c

2024-11-28 Thread Michael Paquier
psql: Sprinkle more CppAsString2() in describe.c Like 91f5a4a000ea for pg_amcheck, this makes the code more self-documented as there is less need to look in the headers what a hardcoded value means. This touches queries related to procedures, AMs, functions, databases, relations, constraints, col

Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque

2024-11-28 Thread Tom Lane
Richard Guo writes: > On Fri, Nov 29, 2024 at 7:33 AM Tom Lane wrote: >> It seems to be sufficient to just not mark lateral >> references at all in this case. (I have a nagging feeling that more >> complexity may be needed in cases where there are several levels of >> outer join, but some attemp

Re: pgsql: Avoid mislabeling of lateral references when pulling up a subque

2024-11-28 Thread Richard Guo
On Fri, Nov 29, 2024 at 7:33 AM Tom Lane wrote: > It seems to be sufficient to just not mark lateral > references at all in this case. (I have a nagging feeling that more > complexity may be needed in cases where there are several levels of > outer join, but some attempts to break it with that di

pgsql: Fix typo in header comment for set_operation_ordered_results_use

2024-11-28 Thread David Rowley
Fix typo in header comment for set_operation_ordered_results_useful Reported-by: Richard Guo Discussion: https://postgr.es/m/cambws492vmy3xnjdzrtqthfftk6hvedwhreqh7exggf_h5j...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b6612aedc53a6bf069eba5e35

pgsql: Fix wording in comment

2024-11-28 Thread Daniel Gustafsson
Fix wording in comment Author: Peter Smith Reviewed-by: vignesh C Discussion: https://postgr.es/m/cahut+pve+2t2etdtahi3n+xbcg_uyrshqucbaadjcfppqgl...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/0c01f509a38f5b1f5fab26d98ae55d796541c2e4 Modified