Skip site navigation (1) Skip section navigation (2)

Design advice needed.

From: Mark Kelly <pgsql(at)wastedtimes(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Design advice needed.
Date: 2007-04-04 21:31:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

I have been asked to produce a website for selling a very varied range of 
items, around 5000 in all. The client wants to be able to categorise items 
in a hierarchical tree, along the lines of "exhaust > round > gold > 
honda" (it's motorbike parts) but wants to be able to use an unspecified 
number of levels and have that number differ between categories. For 
instance, exhausts might drill down 4 layers of categories, whereas stands 
may only have 2 layers, and he can't tell me the max number of layers as 
his range not only varies alot but changes frequently. I hope I am 
explaining this okay.

Obviously I cannot simply add a column for each successive layer of 
categorisation if I don't know in advance how many layers I need. Can this 
kind of "free-form" categorisation be done with Postgres? I am prepared 
for the fact that I may have to limit him to an arbitrary depth, but I'm 
rather curious about the if and how of this :)

The site is written in php, and if I have to do some of the heavy lifting 
in the code there, thats fine. I'd still need advice about setting up the 
tables though.




pgsql-novice by date

Next:From: Sean DavisDate: 2007-04-04 22:04:48
Subject: Re: Design advice needed.
Previous:From: Peter SchonefeldDate: 2007-04-04 01:36:40
Subject: looping multi-dimensional array

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group