Re: Table Design for Hierarchical Data - Mailing list pgsql-sql

From silly sad
Subject Re: Table Design for Hierarchical Data
Date
Msg-id 4BBC39DC.6050502@bankir.ru
Whole thread Raw
In response to Re: Table Design for Hierarchical Data  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Responses Re: Table Design for Hierarchical Data
List 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 by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: Table Design for Hierarchical Data
Next
From: Yeb Havinga
Date:
Subject: Re: Table Design for Hierarchical Data