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

Re: Design advice needed.

From: Mark Kelly <pgsql(at)wastedtimes(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Design advice needed.
Date: 2007-04-04 22:34:26
Message-ID: 200704042334.26288.pgsql@wastedtimes.net (view raw or flat)
Thread:
Lists: pgsql-novice
On Wednesday 04 April 2007 23:04, Sean Davis wrote:
> Mark Kelly wrote:
> > 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.
>
> The categories are not really hierarchical, are they?  A person could
> just as easily start with "honda" in the example above as with
> "exhaust".  

Light-bulb appears above head.

> I would think instead of making a categories that contains 
> all the categories.  You will need an items table that contains all the
> items.  Finally, you will want a table that maps items to categories.

That's absolutely ideal. I have actually done another database this way in 
the past (mapping books into genres) but the clients insistence on the 
hierarchy had kinda locked me into looking at it his way IYSWIM. Thank 
you. Not only can I proceed happily with this now, I can offer facilities 
above and beyond what the client is asking for which I always try to do 
when the spec is informal enough.

Thanks again,

Mark


In response to

pgsql-novice by date

Next:From: Mark KellyDate: 2007-04-04 22:52:15
Subject: Re: Design advice needed.
Previous:From: Richard Broersma JrDate: 2007-04-04 22:08:30
Subject: Re: Design advice needed.

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