Re: Json table/column design question
От
Laurenz Albe
Тема
Re: Json table/column design question
Дата
Msg-id
f053e31c3c2e40541406ce4c266818dbbcfca7b2.camel@cybertec.at
Ответ на
Json table/column design question (Skorpeo Skorpeo)
Список
Дерево обсуждения
Json table/column design question Skorpeo Skorpeo <skorpeo11@gmail.com>
Re: Json table/column design question Muhammad Salahuddin Manzoor <salahuddin.m@bitnine.net>
Re: Json table/column design question "David G. Johnston" <david.g.johnston@gmail.com>
Re: Json table/column design question Laurenz Albe <laurenz.albe@cybertec.at>
Re: Json table/column design question Skorpeo Skorpeo <skorpeo11@gmail.com>
Re: Json table/column design question Adrian Klaver <adrian.klaver@aklaver.com>
Re: Json table/column design question "David G. Johnston" <david.g.johnston@gmail.com>
Re: Json table/column design question Laurenz Albe <laurenz.albe@cybertec.at>
On Wed, 2024-05-22 at 22:38 -0500, Skorpeo Skorpeo wrote: > I was wondering if having unrelated columns in a table is a sound approach when > using json. In other words, if I have two collections of unrelated json objects, > for example "Users" and "Inventory", would it be ok to have one table with a > "Users" column and a "Inventory" column? My concern is that from a row > perspective the columns could be different lengths, such as more inventory > items as users. And for any given row the data in one column would have no > relation to another column. I would only query a single column at a time. > > Would this approach be ok or are there pitfalls such that it would be > advantageous/recommended to have a separate table for each column? It doesn't matter much if you use one or two columns. But the word "collection" makes me worry. Perhaps this article can give you some ideas: https://www.cybertec-postgresql.com/en/json-postgresql-how-to-use-it-right/ Yours, Laurenz Albe
В списке pgsql-general по дате отправления