The following bug has been logged on the website:
Bug reference: 14924
Logged by: Christian Duta
Email address: christianmduta@gmail.com
PostgreSQL version: 10.1
Operating system: macOS High Sierra 10.13.1
Description:
When working with recursive CTEs, I had the following happen:
Evaluating the following
-- List numbers from 1 to 10.
WITH RECURSIVE
steps(i) AS (
SELECT 1
UNION
SELECT val.x
FROM steps AS s,
LATERAL (
VALUES
((SELECT s.i + 1)),
(s.i + 1)
) AS val(x)
WHERE s.i < 10
)
SELECT *
FROM steps;
results in
ERROR: XX000: SubPlan found with no parent plan
LOCATION: ExecInitExprRec, execExpr.c:1013