pgsql: pgindent: filter files for the --commit option

2023-02-12 Thread Andrew Dunstan
pgindent: filter files for the --commit option per gripe from Shi Yu, solution from Jelte Fennema Also add a check that the file exists, and issue a warning if it doesn't. As an efficiency measure, avoid processing any file more than once. Discussion: https://postgr.es/m/tyapr01mb6315b86619944

pgsql: Sync pg_bsd_indent's copyright notices with Postgres practice.

2023-02-12 Thread Tom Lane
Sync pg_bsd_indent's copyright notices with Postgres practice. To avoid confusion, make the copyright notices in these files match the 3-clause form of the BSD license, per the blanket policy update that UC Berkeley issued years ago. Discussion: https://postgr.es/m/[email protected]

pgsql: Integrate pg_bsd_indent into our build/test infrastructure.

2023-02-12 Thread Tom Lane
Integrate pg_bsd_indent into our build/test infrastructure. Update the Makefile and build directions for in-tree build, and add Meson build infrastructure. Also convert the ad-hoc test target into a TAP test. Currently, the Make build system will not build pg_bsd_indent by default, while the Mes

pgsql: Import pg_bsd_indent sources.

2023-02-12 Thread Tom Lane
Import pg_bsd_indent sources. This brings in an exact copy of the pg_bsd_indent repo as of commit d301442799cea44e5ccb04331afc537764ec77c5 (2020-12-28). Discussion: https://postgr.es/m/[email protected] Discussion: https://postgr.es/m/[email protected]

pgsql: Avoid dereferencing an undefined pointer in DecodeInterval().

2023-02-12 Thread Tom Lane
Avoid dereferencing an undefined pointer in DecodeInterval(). Commit e39f99046 moved some code up closer to the start of DecodeInterval(), without noticing that it had been implicitly relying on previous checks to reject the case of empty input. Given empty input, we'd now dereference a pointer th

pgsql: Avoid dereferencing an undefined pointer in DecodeInterval().

2023-02-12 Thread Tom Lane
Avoid dereferencing an undefined pointer in DecodeInterval(). Commit e39f99046 moved some code up closer to the start of DecodeInterval(), without noticing that it had been implicitly relying on previous checks to reject the case of empty input. Given empty input, we'd now dereference a pointer th

pgsql: Make pg_bsd_indent's .h files inclusion-order-safe.

2023-02-12 Thread Tom Lane
Make pg_bsd_indent's .h files inclusion-order-safe. As-is, they failed headerscheck. Per buildfarm. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/6ded4a5a3de1e8d5f3ec50efd4a2d7a39d2550a6 Modified Files -- src/tools/pg_bsd_indent/indent.h | 2 ++ 1 fil

Re: pgsql: Make pg_bsd_indent's .h files inclusion-order-safe.

2023-02-12 Thread Andres Freund
Hi, On February 12, 2023 10:06:55 AM PST, Tom Lane wrote: >Make pg_bsd_indent's .h files inclusion-order-safe. > >As-is, they failed headerscheck. Per buildfarm. Cfbot didn't catch this, because it only triggered a warning, not a failure. We probably should add -Werror? Greetings, Andres

Re: pgsql: Make pg_bsd_indent's .h files inclusion-order-safe.

2023-02-12 Thread Tom Lane
Andres Freund writes: > Cfbot didn't catch this, because it only triggered a warning, not a failure. > We probably should add -Werror? Yeah -- nobody is going to go digging through cfbot logs for warnings, especially when they know that the Compiler Warnings task is supposed to complain about t

Re: pgsql: Make pg_bsd_indent's .h files inclusion-order-safe.

2023-02-12 Thread Andres Freund
Hi, On February 12, 2023 1:11:08 PM PST, Tom Lane wrote: >Andres Freund writes: >> Cfbot didn't catch this, because it only triggered a warning, not a failure. >> We probably should add -Werror? > >Yeah -- nobody is going to go digging through cfbot logs for warnings, >especially when they kn

Re: pgsql: Make pg_bsd_indent's .h files inclusion-order-safe.

2023-02-12 Thread Tom Lane
Andres Freund writes: > On February 12, 2023 1:11:08 PM PST, Tom Lane wrote: >> I don't think -Werror helps any though; it's a matter of whether the >> cfbot is paying attention to headerscheck's exit status ... > Thomas fixed that part a while ago, but it'll just return 0 if it just is a > war

Re: pgsql: Make pg_bsd_indent's .h files inclusion-order-safe.

2023-02-12 Thread Andres Freund
Hi, On 2023-02-12 16:25:28 -0500, Tom Lane wrote: > Andres Freund writes: > > On February 12, 2023 1:11:08 PM PST, Tom Lane wrote: > >> I don't think -Werror helps any though; it's a matter of whether the > >> cfbot is paying attention to headerscheck's exit status ... > > > Thomas fixed that p

Re: pgsql: Make pg_bsd_indent's .h files inclusion-order-safe.

2023-02-12 Thread Tom Lane
Andres Freund writes: > Obviously that approach could be re-implemented for CI, but givent that it > additionally is somewhat required to make use of headerscheck/cpluspluscheck > locally, it feels better to solve it in headerscheck. And the easiest way for > that seems to be -Werror? Agreed ---

pgsql: Mark more nodes with attribute no_query_jumble

2023-02-12 Thread Michael Paquier
Mark more nodes with attribute no_query_jumble This commit removes most of the Plan and Path nodes, which should never be included in the query jumbling because we ignore these in Query nodes. This is facilitated by making no_query_jumble an inherited attribute, like no_copy, no_equal and no_read

pgsql: Disable WindowAgg inverse transitions when subplans are present

2023-02-12 Thread David Rowley
Disable WindowAgg inverse transitions when subplans are present When an aggregate function is used as a WindowFunc and a tuple transitions out of the window frame, we ordinarily try to make use of the aggregate function's inverse transition function to "unaggregate" the exiting tuple. This optimi

pgsql: Disable WindowAgg inverse transitions when subplans are present

2023-02-12 Thread David Rowley
Disable WindowAgg inverse transitions when subplans are present When an aggregate function is used as a WindowFunc and a tuple transitions out of the window frame, we ordinarily try to make use of the aggregate function's inverse transition function to "unaggregate" the exiting tuple. This optimi

pgsql: Disable WindowAgg inverse transitions when subplans are present

2023-02-12 Thread David Rowley
Disable WindowAgg inverse transitions when subplans are present When an aggregate function is used as a WindowFunc and a tuple transitions out of the window frame, we ordinarily try to make use of the aggregate function's inverse transition function to "unaggregate" the exiting tuple. This optimi

pgsql: Disable WindowAgg inverse transitions when subplans are present

2023-02-12 Thread David Rowley
Disable WindowAgg inverse transitions when subplans are present When an aggregate function is used as a WindowFunc and a tuple transitions out of the window frame, we ordinarily try to make use of the aggregate function's inverse transition function to "unaggregate" the exiting tuple. This optimi

pgsql: Disable WindowAgg inverse transitions when subplans are present

2023-02-12 Thread David Rowley
Disable WindowAgg inverse transitions when subplans are present When an aggregate function is used as a WindowFunc and a tuple transitions out of the window frame, we ordinarily try to make use of the aggregate function's inverse transition function to "unaggregate" the exiting tuple. This optimi

pgsql: Disable WindowAgg inverse transitions when subplans are present

2023-02-12 Thread David Rowley
Disable WindowAgg inverse transitions when subplans are present When an aggregate function is used as a WindowFunc and a tuple transitions out of the window frame, we ordinarily try to make use of the aggregate function's inverse transition function to "unaggregate" the exiting tuple. This optimi

pgsql: Fix incorrect presorted DISTINCT aggregate if condition

2023-02-12 Thread David Rowley
Fix incorrect presorted DISTINCT aggregate if condition Here we fix a faulty "if" condition which failed to correctly handle two or more consecutive NULL transition values when checking if the new value is DISTINCT from the old value for presorted aggregates. Given a suitably non-strict aggregate