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

From Ricebot
Subject Data model question regarding usage of arrays.
Date
Msg-id 1143507534.272197.205920@i39g2000cwa.googlegroups.com
Whole thread Raw
Responses Re: Data model question regarding usage of arrays.  ("Ricebot" <test985@hotmail.com>)
List pgsql-general
Hi,

I'm looking at a very simple database that contains a table
of recipes and a table of ingredients with nutritional content.

I'd defined the schema as such

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

CREATE TABLE recipes
(
   uid integer,
   ingredients integer[] -- uids in table ingredients
)

however I am reading that overall the usage of arrays in
data schema is frowned upon.

This seemed the lowest level @ which I could do things.

Is there a higher level SQL concept that would encapsulate
the "many to many" mapping of rows in the recipes table to
rows in the ingredients table?

Thanks,
- Eric


pgsql-general by date:

Previous
From: Michael Talbot-Wilson
Date:
Subject: FAQ 1.1
Next
From: "Marc G. Fournier"
Date:
Subject: Re: FAQ 1.1