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