Search Postgresql Archives

Re: Data model question regarding usage of arrays.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux