About connectby()

From: Masaru Sugawara <rk73(at)sea(dot)plala(dot)or(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: About connectby()
Date: 2002-09-07 12:41:43
Message-ID: 20020907214052.AF42.RK73@sea.plala.or.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message snpe 2002-09-07 12:59:31 Re: [JDBC] problem with new autocommit config parameter and jdbc
Previous Message Bruno Wolff III 2002-09-07 12:01:01 Re: Making small bits of code available

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2002-09-07 15:35:20 Re: About connectby()
Previous Message Alvaro Herrera 2002-09-07 01:57:49 Re: indisclustered and clusterdb