Re: Stability of JSON textual representation

Поиск
Список
Период
Сортировка
От David Evans
Тема Re: Stability of JSON textual representation
Дата
Msg-id CAHbVmPyxOJzJkZ1aR=qNKNfz5Y4464e--rF-1GF9=SJZxyVAmg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Stability of JSON textual representation  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Ответы Re: Stability of JSON textual representation  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
On 9 February 2015 at 03:57, Gavin Flower <GavinFlower@archidevsys.co.nz> 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

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

Предыдущее
От: Oliver
Дата:
Сообщение: Re: Change postgresql encoding
Следующее
От: Vladislav Tchernev
Дата:
Сообщение: Mult-standby streaming replication master failover