> On 28 Nov 2022, at 10:09, PG Bug reporting form <noreply@postgresql.org> wrote:
> When executing the following query:
>
> WITH table3 ( column34 ) AS NOT MATERIALIZED ( SELECT 1 ) SELECT 1 FROM (
> SELECT 1 FROM table3 WHERE column34 = ANY ( SELECT alias4 . column34 FROM
> table3 FULL JOIN table3 AS alias4 ON TRUE )) AS alias5 ;
The full join on the rhs of the semi join creates a PlaceHolderVar due to
table3 not being materialized. A slightly shorter repro is:
with table3 as not materialized (
select 1 as column34
)
select 1 from table3
where column34 in (
select alias4.column34 from table3
full join table3 as alias4 on true
);
--
Daniel Gustafsson https://vmware.com/