Re: Re: Turn a json column into a table

Поиск
Список
Период
Сортировка
От Shaozhong SHI
Тема Re: Re: Turn a json column into a table
Дата
Msg-id CA+i5JwbFt15pUb6DvnNfn2hy1VdfK27KHKBxv0J+DzyhKivokA@mail.gmail.com
обсуждение исходный текст
Ответ на Aw: Re: Turn a json column into a table  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-sql


On Tue, 15 Feb 2022 at 08:09, Karsten Hilbert <Karsten.Hilbert@gmx.net> wrote:
Hi Ion,

> it seems (json_to_record, jsonb_to_record) may help in this use case.
> https://www.postgresql.org/docs/9.4/functions-json.html

json_to_record seems promising. Is there any excellent Postgresql example ?

Karsten


Hi, Karsten
I tried the folowing;
SELECT x.* FROM structures.str_fts_compoundstructure t, json_to_record(properties) AS x(a_key text, b_key text, theme text, changetype text); 
There are two similar fields, a_key, b_key ---identifiers.

But, a_key came out properly, but b_key came out all null.  Frustrating.

Regards,

David

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

Предыдущее
От: Shaozhong SHI
Дата:
Сообщение: Advancing the capability of Postgres and PostGIS
Следующее
От: Shaozhong SHI
Дата:
Сообщение: Re: Re: Re: Turn a json column into a table