Prevent inlining of multiply-referenced CTEs with outer recursive refs.
Tom Lane <tgl@sss.pgh.pa.us>
Prevent inlining of multiply-referenced CTEs with outer recursive refs. This has to be prevented because inlining would result in multiple self-references, which we don't support (and in fact that's disallowed by the SQL spec, see statements about linearly vs. nonlinearly recursive queries). Bug fix for commit 608b167f9. Per report from Yaroslav Schekin (via Andrew Gierth) Discussion: https://postgr.es/m/87wolmg60q.fsf@news-spur.riddles.org.uk
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/plan/subselect.c | modified | +66 −0 |
| src/test/regress/expected/subselect.out | modified | +100 −0 |
| src/test/regress/sql/subselect.sql | modified | +35 −0 |
Discussion
- Early WIP/PoC for inlining CTEs 113 messages · 2018-07-24 → 2019-04-09