Re: Data model question regarding usage of arrays. - Mailing list pgsql-general

From Ricebot
Subject Re: Data model question regarding usage of arrays.
Date
Msg-id 1143507957.734467.324970@v46g2000cwv.googlegroups.com
Whole thread Raw
In response to Data model question regarding usage of arrays.  ("Ricebot" <test985@hotmail.com>)
Responses Re: Data model question regarding usage of arrays.  ("Ricebot" <test985@hotmail.com>)
List pgsql-general
Solution

CREATE TABLE ingredients
(
    uid integer,
    ...     -- nutritional info
)

CREATE TABLE recipes
(
   uid integer,
   uid_bridge integer -- uids in bridge table
)

CREATE TABLE bridge
(
   uid integer,
   uid_ingredients integer -- uids in table ingredients
)

rows in recipes table can be unique for each recipe, rows in
bridge table are a row per recipe per ingredient in that recipe.


pgsql-general by date:

Previous
From: Douglas McNaught
Date:
Subject: Re: FAQ 1.1
Next
From: "Ricebot"
Date:
Subject: Re: Data model question regarding usage of arrays.