pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Prevent inlining of multiply-referenced CTEs with outer recursiv
Date: Tue, 09 Apr 2019 19:47:53 +0000
Message-ID: <E1hDwin-0004N7-0L@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9476131278c7bfc435ad9a21fc8e981272ac0dd2

Modified Files
--------------
src/backend/optimizer/plan/subselect.c  |  66 +++++++++++++++++++++
src/test/regress/expected/subselect.out | 100 ++++++++++++++++++++++++++++++++
src/test/regress/sql/subselect.sql      |  35 +++++++++++
3 files changed, 201 insertions(+)



Message-ID: <E1hDwin-0004N7-0L@gemulon.postgresql.org>
Permalink:  ../E1hDwin-0004N7-0L@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hDwin-0004N7-0L@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Prevent inlining of multiply-referenced CTEs with outer recursiv
  In-Reply-To: <E1hDwin-0004N7-0L@gemulon.postgresql.org>
  References: <E1hDwin-0004N7-0L@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox