Stability of JSON textual representation

From: David Evans <david(dot)evans(at)cantab(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Stability of JSON textual representation
Date: 2015-02-02 11:06:37
Message-ID: CAHbVmPzS+sVR+y-UgxjRq+XW4dqteVL-cOzc69zFFwmxjcKCxg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message theftp 2015-02-02 14:52:25 Re: BDR Error restarted
Previous Message Albe Laurenz 2015-02-02 09:58:31 Re: Can I habe multi table indices?