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

From Scott Marlowe
Subject Re: Table Design for Hierarchical Data
Date
Msg-id k2xdcc563d11004062317g35914f60r49ea20612632b0e3@mail.gmail.com
Whole thread Raw
In response to Re: Table Design for Hierarchical Data  (silly sad <sad@bankir.ru>)
List pgsql-sql
On Tue, Apr 6, 2010 at 11:43 PM, silly sad <sad@bankir.ru> wrote:
> P.S.
> almost foget, do not try any oracle-like "tree-jouns" or "special types" or
> such a crap.
>
> your problem as plain as to store a pair of integers
> (or numerics (i prefer))

Since it's an identifier and not really a numeric per se, I'd store it
as text.  I mean it could as easily be a 5 character alpha code as 5
character number code.

With tet you can create indexes on substring(idfield,1,1),
substring(idfield,1,2), substring(idfield,1,3),
substring(idfield,1,4), and substring(idfield,1,5) for fast lookups
and matching.


pgsql-sql by date:

Previous
From: silly sad
Date:
Subject: Re: Table Design for Hierarchical Data
Next
From: Achilleas Mantzios
Date:
Subject: Re: Table Design for Hierarchical Data