Re: BUG #6498: with recursive / union all

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nish2575(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6498: with recursive / union all
Date: 2012-02-29 20:48:48
Message-ID: 7426.1330548528@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

nish2575(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Christophe Pettus 2012-02-29 21:05:20 Re: BUG #6497: Error sent to client, but data written anyway
Previous Message Tom Lane 2012-02-29 18:56:04 Re: BUG #6497: Error sent to client, but data written anyway