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

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

 



> On 09/03/2023 17:05 CET Erik Wienhold <ewie@xxxxxxxxx> 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





[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux