Re: BUG #6498: with recursive / union all - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6498: with recursive / union all
Date
Msg-id 7426.1330548528@sss.pgh.pa.us
Whole thread Raw
In response to BUG #6498: with recursive / union all  (nish2575@gmail.com)
Responses Re: BUG #6498: with recursive / union all
List pgsql-bugs
nish2575@gmail.com writes:
> 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;

Why would it?  You don't have any loops in the data.  In particular that
means there will be no join matches after a certain number of levels.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Ryan Lowe
Date:
Subject: Re: BUG #6497: Error sent to client, but data written anyway
Next
From: Christophe Pettus
Date:
Subject: Re: BUG #6497: Error sent to client, but data written anyway