From: | Victor Hugo <vh(dot)clemente(at)gmail(dot)com> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Table-design for categories, suggestions needed |
Date: | 2010-08-07 12:27:26 |
Message-ID: | AANLkTi=S-ViscVN180OCVS=Xq0iP86mkcYoW7mMjpR2J@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Hi,
Think that an error of modeling. Occur this way, where there are 5
types of subcategory in the table, there could be another table
containing the information category and subcategory. Got it?
exemple:
TABLE categories (id, name_category)
TABLE subcategories (id, name_subcategory)
TABLE components (id, name_component)
TABLE category_subcategory (id_category references categories(id),
id_subcategory references subcategories(id) )
I think it would be better to model your system.
Bye,
Victor Hugo
2010/8/7 gargoyle60 <gargoyle60(at)example(dot)invalid>:
> On Fri, 06 Aug 2010 19:54:01 -0400, Lew <noone(at)lewscanon(dot)com> wrote:
>
>>On 08/05/2010 04:06 AM, gargoyle60 wrote:
>>> Oops, that should read...
>>> ...
>>> FOREIGN KEY (parent_level)
>>> REFERENCES category (category_level)
>>
>>So category (category_level) is a unique or primary key, then.
>
> Something like that, probably with (category_level, category_code).
> Like I said, I never got around to implementing the provisional design and there may be more to it
> than that.
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice
>
--
[]´s
Victor Hugo
From | Date | Subject | |
---|---|---|---|
Next Message | Lew | 2010-08-07 12:28:37 | Re: Table-design for categories, suggestions needed |
Previous Message | gargoyle60 | 2010-08-07 07:35:14 | Re: Table-design for categories, suggestions needed |