Re: About connectby()

From: Masaru Sugawara <rk73(at)sea(dot)plala(dot)or(dot)jp>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: About connectby()
Date: 2002-09-08 13:35:12
Message-ID: 20020908222757.DD7F.RK73@sea.plala.or.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Sat, 07 Sep 2002 10:26:36 -0700
Joe Conway <mail(at)joeconway(dot)com> wrote:

>
> OK -- patch submitted to fix this. Once the patch is applied, this case
> gives:
>
> test=# SELECT * FROM connectby('connectby_tree', 'keyid',
> 'parent_keyid', '2', 0, '~') AS t(keyid int, parent_keyid int, level
> int, branch text);
> ERROR: infinite recursion detected

Thank you for your patch.

>
> If you specifically limit the depth to less than where the repeated key
> is hit, everything works as before:

And I also think this approach is reasonable.

>
> test=# SELECT * FROM connectby('connectby_tree', 'keyid',
> 'parent_keyid', '2', 4, '~') AS t(keyid int, parent_keyid int, level
> int, branch text);
> keyid | parent_keyid | level | branch
> -------+--------------+-------+-------------
> 2 | | 0 | 2
> 4 | 2 | 1 | 2~4
> 6 | 4 | 2 | 2~4~6
> 8 | 6 | 3 | 2~4~6~8
> 5 | 2 | 1 | 2~5
> 9 | 5 | 2 | 2~5~9
> 10 | 9 | 3 | 2~5~9~10
> 11 | 10 | 4 | 2~5~9~10~11
> (8 rows)
>
> Thanks for the feedback!
>
> Joe
>
>

Regards,
Masaru Sugawara

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hervé Piedvache 2002-09-08 14:21:27 Importing data from 7.2.2 into 7.3b1 !?
Previous Message Michael Meskes 2002-09-08 08:20:11 7.3beta and ecpg

Browse pgsql-patches by date

  From Date Subject
Next Message Arturo Josè Montes Sinning 2002-09-09 02:52:01 Patch to support ordering of tid
Previous Message Bruno Wolff III 2002-09-08 06:13:14 cube and earthdistance diffs