Data model question regarding usage of arrays.

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc G. Fournier 2006-03-28 00:59:36 Re: FAQ 1.1
Previous Message Michael Talbot-Wilson 2006-03-28 00:40:15 FAQ 1.1