Re: Table Design for Hierarchical Data
| От | silly sad |
|---|---|
| Тема | Re: Table Design for Hierarchical Data |
| Дата | |
| Msg-id | 4BBC39DC.6050502@bankir.ru обсуждение исходный текст |
| Ответ на | Re: Table Design for Hierarchical Data (Achilleas Mantzios <achill@matrix.gatewaynet.com>) |
| Ответы |
Re: Table Design for Hierarchical Data
|
| Список | pgsql-sql |
On 04/07/10 11:00, Achilleas Mantzios wrote:
> Column | Type | Modifiers
> ---------+-----------+---------------------------------------------------------------------------
> id | integer | not null default nextval(('public.paintgentypes_id_seq'::text)::regclass)
> name | text | not null
> parents | integer[] |
> The parents of any node to the root, i.e. the path of any node to the root are depicted as
> parents[0] : immediate parent
> parents[1] : immediate parent of the above parent
> .....
> parents[n] : root of the tree
what this schema gives?
(1) the parent branch in one select.
what else?
nothing.
compare it to a nested-tree
id | integer | NOT NULL name | text | not null parent | integer | l | numeric r
| numeric
(1) parent branch in one select
(2) child subtree in one select
(it makes a sence!)
В списке pgsql-sql по дате отправления: