christianmduta@gmail.com writes:
> When working with recursive CTEs, I had the following happen:
Thanks for the report! Seems not to be specific to CTEs:
regression=# SELECT val.x FROM generate_series(1,10) AS s(i), LATERAL ( VALUES ((SELECT s.i + 1)), (s.i + 1) )
ASval(x) WHERE s.i < 10;
ERROR: SubPlan found with no parent plan
However, simplifying further, this works:
regression=# SELECT val.x FROM generate_series(1,10) AS s(i), LATERAL ( VALUES ((SELECT 1 + 1)), (s.i + 1) ) AS
val(x)WHERE s.i < 10;
so it looks like it's the LATERAL reference inside the sub-select
that is needed to trigger the bug.
Same results back to 9.3 :-(
regards, tom lane