Data model question regarding usage of arrays.

Поиск
Список
Период
Сортировка
От Ricebot
Тема Data model question regarding usage of arrays.
Дата
Msg-id 1143507534.272197.205920@i39g2000cwa.googlegroups.com
обсуждение исходный текст
Ответы Re: Data model question regarding usage of arrays.  ("Ricebot" <test985@hotmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Michael Talbot-Wilson
Дата:
Сообщение: FAQ 1.1
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: FAQ 1.1