From: nish2575@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #6498: with recursive / union all
Date: Wed, 29 Feb 2012 18:11:28 +0000
Message-ID: <E1S2nzs-0007NC-Jd@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 6498
Logged by: kanishka
Email address: nish2575@gmail.com
PostgreSQL version: 9.0.6
Operating system: Linux 2.6.41.4-1.fc15.i686 / fedora 15
Description:
here is an example of what i believe the system is not obeying the
expectation of a union all instead of a union, in a recursive with query
that uses a join. the documentation page on with queries also has an example
with union all over an acyclic graph data set that i believe should loop
infinitely according the descriptoin of with query processing.
this doesn't loop infinitely:
insert into acyc values ('a','b') ,('b','c');
with recursive paths as (
select frm, too, 1 as lvl from acyc
union all
select fnd.frm, a.too, lvl + 1 from acyc a join paths fnd on fnd.too =
a.frm ) select * from paths;
while this does loop infinitely:
with recursive p as (select 5 union all select * from p ) select * from p;
my guess is the performing of the join is causing duplicates inadvertantly.
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-bugs@postgresql.org
Cc: nish2575@gmail.com
Subject: Re: BUG #6498: with recursive / union all
In-Reply-To: <E1S2nzs-0007NC-Jd@wrigleys.postgresql.org>
References: <E1S2nzs-0007NC-Jd@wrigleys.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