Re: [SQL] Tree structure

2000-09-11 Thread Zeljko Trogrlic

Normally it's done with self-relation. You need a table with
"ID" and "PARENT_ID". PARENT_ID will contain null for
root level and other row's ID for children. One warning: going through
such tree could be slow. I don't know is there anything PostgreSQL
specific that might help. I know that Oracle have a special tree
command.

At 14:27 11.9.2000 , Trewern, Ben wrote: 

Anybody know how to make a tree
structure using related tables using Postgres.  Something like a
directory structure is what I'm aiming for.  I'm sure there is an
easy way but I'm having probs.

Any help would be appreciated. 

Ben. 





Re: [SQL] Tree structure

2000-09-12 Thread Zeljko Trogrlic

Thanks for your offer, I'll be very interested to see how you did that. I
also found very interesting solution at

http://www.dbmsmag.com/9603d06.html
http://www.dbmsmag.com/9604d06.html
http://www.dbmsmag.com/9605d06.html

At 11:22 12.9.2000 , kovacsz wrote:
>We are using tree structures (and partially ordered trees) with
>PostgreSQL. After the beginning success we got into speed problems. With
>special plus tables, triggers and functions now we have a reasonably fast
>database which contains about 5-10 tree structures. If you are interested,
>I may send you some of these part of our database. But, PostgreSQL "from 
>base" doesn't support tree structures, neither recursions (like in SQL3), 
>as far as I know (see TODO list).