Stability of JSON textual representation

Поиск
Список
Период
Сортировка
От David Evans
Тема Stability of JSON textual representation
Дата
Msg-id CAHbVmPzS+sVR+y-UgxjRq+XW4dqteVL-cOzc69zFFwmxjcKCxg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Stability of JSON textual representation  (Paul Jungwirth <pj@illuminatedcomputing.com>)
Re: Stability of JSON textual representation  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Список pgsql-general
I've noticed that when representing lists as JSON, Postgres 9.4 sometimes outputs spaces after commas, and other times does not.

# SELECT array_to_json(array[1, 2, 3]), json_build_array(1, 2, 3);

 array_to_json | json_build_array 
---------------+------------------
 [1,2,3]       | [1, 2, 3]

This matters to me because I'm intending the hash the JSON text and use the hash for change detection.

This difference in behaviour doesn't seem to be documented anywhere. Does anyone know whether it is likely to be stable?

Many thanks,

Dave

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

Предыдущее
От: Tim Uckun
Дата:
Сообщение: Re: Partioning with overlapping and non overlapping constraints
Следующее
От: Ramesh T
Дата:
Сообщение: postgres cust types