]> granicus.if.org Git - postgresql/commit
Prevent inlining of multiply-referenced CTEs with outer recursive refs.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 9 Apr 2019 19:47:26 +0000 (15:47 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 9 Apr 2019 19:47:35 +0000 (15:47 -0400)
commit9476131278c7bfc435ad9a21fc8e981272ac0dd2
tree5d11701ff0010bcc5ba923d55b18ed8c3db607b8
parent4dba0f6dc407f965924d6c1007ac1bb5cc209dde
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
src/backend/optimizer/plan/subselect.c
src/test/regress/expected/subselect.out
src/test/regress/sql/subselect.sql