BUG #14924: Subquery in VALUES inside recursive CTE
christianmduta@gmail.com
From: christianmduta@gmail.com
To: pgsql-bugs@postgresql.org
Cc: christianmduta@gmail.com
Date: 2017-11-24T12:08:36Z
Lists: pgsql-bugs
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
Commits
-
Repair failure with SubPlans in multi-row VALUES lists.
- d538f65684a5 9.3.21 landed
- ae6ed0784176 9.5.11 landed
- 9b63c13f0a21 11.0 landed
- 5dc7faa91e19 10.2 landed
- 497e79b96135 9.6.7 landed
- 2e105cf6db21 9.4.16 landed
-
Arrange for ValuesScan to keep per-sublist expression eval state in a
- 0dfb595d7a5e 8.2.0 cited