About connectby() - Mailing list pgsql-hackers

From Masaru Sugawara
Subject About connectby()
Date
Msg-id 20020907214052.AF42.RK73@sea.plala.or.jp
Whole thread Raw
List pgsql-hackers
Now I'm testing connectby()  in the /contrib/tablefunc in 7.3b1, which would
be a useful function for many users.   However, I found the fact that
if connectby_tree has the following data, connectby() tries to search the end
of roots without knowing that the relations are infinite(-5-9-10-11-9-10-11-) .
I hope connectby() supports a check routine to find infinite relations. 


CREATE TABLE connectby_tree(keyid int, parent_keyid int);
INSERT INTO connectby_tree VALUES(1,NULL);
INSERT INTO connectby_tree VALUES(2,1);
INSERT INTO connectby_tree VALUES(3,1);
INSERT INTO connectby_tree VALUES(4,2);
INSERT INTO connectby_tree VALUES(5,2);
INSERT INTO connectby_tree VALUES(6,4);
INSERT INTO connectby_tree VALUES(7,3);
INSERT INTO connectby_tree VALUES(8,6);
INSERT INTO connectby_tree VALUES(9,5);

INSERT INTO connectby_tree VALUES(10,9);
INSERT INTO connectby_tree VALUES(11,10);
INSERT INTO connectby_tree VALUES(9,11);    <-- infinite



Regards,
Masaru Sugawara




pgsql-hackers by date:

Previous
From: snpe
Date:
Subject: Re: [JDBC] problem with new autocommit config parameter and jdbc
Next
From: Bruce Momjian
Date:
Subject: Re: [JDBC] problem with new autocommit config parameter and