Re: which is better- storing data as array or json?

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: which is better- storing data as array or json?
Дата
Msg-id 54E410EE.9050609@hogranch.com
обсуждение исходный текст
Ответ на Re: which is better- storing data as array or json?  (zach cruise <zachc1980@gmail.com>)
Список pgsql-general
On 2/17/2015 8:00 PM, zach cruise wrote:
> i can't keep creating tables or adding columns every time i need to
> add a nickname- this happens a lot.
>
> so i want to put everything in an array or json.
>
> remember rows can have different number of nicknames.

david was suggesting a join table.

one table with names (id, first name, last name, other attributes...)
with one row per person

and another table with (id, names_id, nickname, nickname attribute) with
as many rows as there are nicks and users...

you'd join these to get all the nicks for a given name, or to get all
the names for a given nickname, etc.



--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



В списке pgsql-general по дате отправления:

Предыдущее
От: zach cruise
Дата:
Сообщение: Re: which is better- storing data as array or json?
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: which is better- storing data as array or json?