On Aug 5, 2010, at 3:50 PM, Rikard Bosnjakovic
> Perhaps a better example is an Ebay-listing. For a random page I have
> open right now I see at the top: "Listed in category: Mobile & Home
> Phones > Mobile Phone Accessories > Other Mobile Phone Accessories >
> Other Mobile Phone Accessories".
> This "chain" is what I'm trying to duplicate.
Okay, then what you are trying to model is a tree.
Postgresql has a special contrib module called Ltree that manages this nicely.
Other than this, there are three data models that you can choose from:
Adjacency list model Aka BOM model
Path enumeration model
Nested set model
The first model is probably the easiest to grasp. And since pg 8.4 supports recursive queries this model becomes a nice choice.
Sent from my iPod
In response to
pgsql-novice by date
|Next:||From: Carel Combrink||Date: 2010-08-06 13:36:40|
|Subject: Libpq in C Language Function|
|Previous:||From: Leon Starr||Date: 2010-08-06 04:21:00|
|Subject: Best way to test/develop lots of nested functions?|