Обсуждение: BUG #4370: connectby method

Поиск
Список
Период
Сортировка

BUG #4370: connectby method

От
"Derek & Bob"
Дата:
The following bug has been logged online:

Bug reference:      4370
Logged by:          Derek & Bob
Email address:      yinliangdl@163.com
PostgreSQL version: 8.3.0
Operating system:   Linux
Description:        connectby method
Details:

I've got a question about table connectby method. Say, we have five elements
which are 1,2,3,4,5. Each of them are the roots in the tree.Instead of using
five connectby methods to generate them all in the table, I assume there is
a element 0, which is the parent of them, in the tree(which is not existed
in the real table). So only one  connectby is enough to get them all, and it
works.


I don't know whether it's a bug or it's ok. Thanks.

Re: BUG #4370: connectby method

От
Euler Taveira de Oliveira
Дата:
Derek & Bob escreveu:
> I've got a question about table connectby method. Say, we have five elements
> which are 1,2,3,4,5. Each of them are the roots in the tree.Instead of using
> five connectby methods to generate them all in the table, I assume there is
> a element 0, which is the parent of them, in the tree(which is not existed
> in the real table). So only one  connectby is enough to get them all, and it
> works.
>
This is *not* a bug. How would connectby guess you want to group all of
the root elements? Maybe another connectby variant that assumes
start_with as an array. A patch would be welcome.


--
  Euler Taveira de Oliveira
  http://www.timbira.com/