Re: functionality like Oracle's "connect by"

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: functionality like Oracle's "connect by"
Дата
Msg-id 877jrfhm6t.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на functionality like Oracle's "connect by"  ("David Parker" <dparker@tazznetworks.com>)
Список pgsql-general
"David Parker" <dparker@tazznetworks.com> writes:

> The functionality I'm looking for is essentially the Oracle "connect
> by". Does anything like this exist for postgresql?

Yes. In the contrib directory of the source is a directory named "tablefunc".
If you've installed from an distribution you might like for a
postgresql-contrib package or something like that.

It has a function that tries to do what you want:


    connectby(text relname, text keyid_fld, text parent_keyid_fld
                [, text orderby_fld], text start_with, int max_depth
                                [, text branch_delim])
      - returns keyid, parent_keyid, level, and an optional branch string
        and an optional serial column for ordering siblings
      - requires anonymous composite type syntax in the FROM clause. See
        the instructions in the documentation below.


I've never tried it though.

--
greg

В списке pgsql-general по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: psqlodbc-07.03.0200 --with-iodbc won7t compile on Mac OS X
Следующее
От: Ulrich Wisser
Дата:
Сообщение: Re: Hebrew support -- please help !