Re: ERROR wrong varnullingrels (b 3) (expected (b)) with LEFT JOIN LATERAL and CTE

2024-11-28 Thread Bertrand Mamasam
On Thu, Nov 28, 2024 at 11:35 PM Tom Lane wrote: > I wrote: > > Thanks for the test case! A quick "git bisect" says I broke it at > > cb8e50a4a09fe541e32cd54ea90a97f2924121a1 is the first bad commit > > commit cb8e50a4a09fe541e32cd54ea90a97f2924121a1 > > Author: Tom Lane > > Date: Fri Aug 30

Re: ERROR wrong varnullingrels (b 3) (expected (b)) with LEFT JOIN LATERAL and CTE

2024-11-28 Thread Tom Lane
I wrote: > Thanks for the test case! A quick "git bisect" says I broke it at > cb8e50a4a09fe541e32cd54ea90a97f2924121a1 is the first bad commit > commit cb8e50a4a09fe541e32cd54ea90a97f2924121a1 > Author: Tom Lane > Date: Fri Aug 30 12:42:12 2024 -0400 > Avoid inserting PlaceHolderVars in ca

Re: ERROR wrong varnullingrels (b 3) (expected (b)) with LEFT JOIN LATERAL and CTE

2024-11-28 Thread Tom Lane
Bertrand Mamasam writes: > Ok thank you, here is a short version of the query that works before 16.5 > but not in 16.5+ anymore. Thanks for the test case! A quick "git bisect" says I broke it at cb8e50a4a09fe541e32cd54ea90a97f2924121a1 is the first bad commit commit cb8e50a4a09fe541e32cd54ea90a

Re: ERROR wrong varnullingrels (b 3) (expected (b)) with LEFT JOIN LATERAL and CTE

2024-11-28 Thread Bertrand Mamasam
On Thu, Nov 28, 2024 at 5:15 PM Tom Lane wrote: > Bertrand Mamasam writes: > > I get this error in PG16.5, 16.6 and 17 : > > wrong varnullingrels (b 3) (expected (b)) for Var 1/19 > > Please provide a self-contained test case. A fragmentary query > with no underlying tables is useless for inves

Re: ERROR wrong varnullingrels (b 3) (expected (b)) with LEFT JOIN LATERAL and CTE

2024-11-28 Thread Tom Lane
Bertrand Mamasam writes: > I get this error in PG16.5, 16.6 and 17 : > wrong varnullingrels (b 3) (expected (b)) for Var 1/19 Please provide a self-contained test case. A fragmentary query with no underlying tables is useless for investigation. https://wiki.postgresql.org/wiki/Guide_to_reportin

ERROR wrong varnullingrels (b 3) (expected (b)) with LEFT JOIN LATERAL and CTE

2024-11-28 Thread Bertrand Mamasam
Hello, My query has been working fine in 16.4 and before, but not anymore in 16.5, 16.6 and 17. It is a query with multiple CTE, some of which are using values of the previous ones, and the end of the query sort of make a mix of found values with aggregation from a LATERAL JOIN. Something like thi