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 ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org