Search Postgresql Archives

Re: Stability of JSON textual representation

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

 



On 9 February 2015 at 03:57, Gavin Flower <GavinFlower@xxxxxxxxxxxxxxxxx> wrote:
 Would using jsonb be more consistent?

Yes, casting to jsonb seems produce consistent output:

# SELECT array_to_json(array[1, 2, 3])::jsonb, json_build_array(1, 2, 3)::jsonb;
 array_to_json | json_build_array 
---------------+------------------
 [1, 2, 3]     | [1, 2, 3]

That makes sense I suppose, given that only the structure in preserved in the jsonb representation.

Thanks! I should have thought of that myself.

Dave

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux