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: 200704042231.23523.pgsql@wastedtimes.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi

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.

Thanks

Mark

Responses

Browse pgsql-novice by date

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