Subject: [Dev] Representing Tree/hierachical data in a relational database

From: John Beimler <[email-masked]>
Date: 19 Jun 2002 23:33:58 -0400

Looking for some suggestions on storing parent/child relationships in a
relational database.  I got spoiled with Oracle and the built in support
for that.  I'd rather not just go with children having a pointer to
their parent, I know there must be a more efficient method.

Thanks

john
-- 
John Beimler
[email-masked]

---

From: Brent Verner <[email-masked]>
Date: Thu, 20 Jun 2002 03:36:43 -0400

[2002-06-19 23:33] John Beimler said:
| Looking for some suggestions on storing parent/child relationships in a
| relational database.  I got spoiled with Oracle and the built in support
| for that.  I'd rather not just go with children having a pointer to
| their parent, I know there must be a more efficient method.

see if this helps.
  
  http://www.intelligententerprise.com/001020/celko1_1.shtml

If not, search for that link in the postgresql.org mailing lists 
(maybe pgsql-users) for other interesting comments on this question.

cheeres.
  b

-- 
"Develop your talent, man, and leave the world something. Records are 
really gifts from people. To think that an artist would love you enough
to share his music with anyone is a beautiful thing."  -- Duane Allman

---

From: Tom Bryan <[email-masked]>
Date: Thu, 20 Jun 2002 21:34:59 +0500

> (maybe pgsql-users) for other interesting comments on this question.

Thanks for that link.  I've never seen that solution to the "parts explosion" 
or "bill of materials" problem before.  Of course, I think that the best 
solution depends on how the data will be used.  His solution looked great for 
apps that mostly need to query subtrees.  It would be horrible if most of the 
queries are one-step drill-downs and the application makes frequent updates 
to the tree structure itself.

---Tom