Re: Recursive use

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: Recursive use
Дата
Msg-id 20061010151541.GF72517@nasby.net
обсуждение исходный текст
Ответ на Re: Recursive use  ("Jay A. Kreibich" <jak@uiuc.edu>)
Ответы Re: Recursive use  ("Jay A. Kreibich" <jak@uiuc.edu>)
Список pgsql-admin
On Fri, Oct 06, 2006 at 10:37:26AM -0500, Jay A. Kreibich wrote:
>   These are generally referred to as "Hierarchical Queries" and center
>   around the idea of a self-referencing table (such as an employee
>   table with a "manager" field that is a FK to another row in the same
>   table).  This essentially makes a tree-like structure.
<snip>
>   As pointed out by others, the most general way to deal with this in
>   PostgreSQL is to write PL/PgSQL (or some other language) functions
>   that can generate the specific queries you need.  It isn't always
>   pretty, but it can be made to work for a specific set of queries.

There are also other ways to represent this type of information without
using hierarchical queries. Joe Celko presents two methods in SQL For
Smarties.

There's also the ltree module in contrib that might be of some use.
--
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: postgres in HA constellation
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Copying data from table to table (cloned tables)