Re: Data model question regarding usage of arrays.

From: "Ricebot" <test985(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Data model question regarding usage of arrays.
Date: 2006-03-28 01:05:57
Message-ID: 1143507957.734467.324970@v46g2000cwv.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ricebot 2006-03-28 01:08:58 Re: Data model question regarding usage of arrays.
Previous Message Douglas McNaught 2006-03-28 01:03:30 Re: FAQ 1.1