Re: Malformed array literal in goin from jsonb to real[]

Поиск
Список
Период
Сортировка
От Erik Wienhold
Тема Re: Malformed array literal in goin from jsonb to real[]
Дата
Msg-id 59706540.193641.1678378377504@office.mailbox.org
обсуждение исходный текст
Ответ на Re: Malformed array literal in goin from jsonb to real[]  (Erik Wienhold <ewie@ewie.name>)
Список pgsql-admin
> On 09/03/2023 17:05 CET Erik Wienhold <ewie@ewie.name> wrote:
>
> Use jsonb_populate_record with a custom type:
>
>     create type myrec as (col real[][]);
>     
>     select * from jsonb_populate_record(null::myrec, '{"col":[[0,1],[2,3]]}');
>     
>           col
>     ---------------
>      {{0,1},{2,3}}
>     (1 row)

I just noticed that it's also possible without a custom type:

    select * from jsonb_to_record('{"col":[[0,1],[2,3]]}') as t(col real[]);

--
Erik



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

Предыдущее
От: Erik Wienhold
Дата:
Сообщение: Re: Malformed array literal in goin from jsonb to real[]
Следующее
От: Piergiorgio Valli
Дата:
Сообщение: Re: postgresql to Oracle database migration