Re: pgsql: Make Vars be outer-join-aware.

2023-01-31 Thread Tom Lane
Robins Tharakan writes: > Since this commit, my test setup is triggering asserts every few minutes. I concluded that assert was just wrong, and removed it. Maybe there is some weaker assertion we could make, but it'd require passing down more context than fix_scan_expr gets now, and it doesn't s

Re: pgsql: Make Vars be outer-join-aware.

2023-01-31 Thread Tom Lane
Robins Tharakan writes: > Since this commit, my test setup is triggering asserts every few minutes. > The repro SQL itself doesn't make much sense, but it's the smallest I could > narrow it down to: > create table t1(a int); > create table t2(a int); > SELECT table_catalog AS c2 > FROM public.t1

Re: pgsql: Make Vars be outer-join-aware.

2023-01-30 Thread Robins Tharakan
Hi Tom, On Tue, 31 Jan 2023 at 05:43, Tom Lane wrote: > > Make Vars be outer-join-aware. > Since this commit, my test setup is triggering asserts every few minutes. The repro SQL itself doesn't make much sense, but it's the smallest I could narrow it down to: create table t1(a int); create tab

pgsql: Make Vars be outer-join-aware.

2023-01-30 Thread Tom Lane
Make Vars be outer-join-aware. Traditionally we used the same Var struct to represent the value of a table column everywhere in parse and plan trees. This choice predates our support for SQL outer joins, and it's really a pretty bad idea with outer joins, because the Var's value can depend on whe