1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Output timestamps in ISO 8601 format when rendering JSON.

Many JSON processors require timestamp strings in ISO 8601 format in
order to convert the strings. When converting a timestamp, with or
without timezone, to a JSON datum we therefore now use such a format
rather than the type's default text output, in functions such as
to_json().

This is a change in behaviour from 9.2 and 9.3, as noted in the release
notes.
This commit is contained in:
Andrew Dunstan
2014-06-03 13:56:53 -04:00
parent 2dfa15de55
commit f30015b6d7
5 changed files with 116 additions and 0 deletions

View File

@@ -162,6 +162,24 @@
</para>
</listitem>
<listitem>
<para>
Values of type
<link linkend="datatype-datetime"><type>timestamp</></link> and
<link linkend="datatype-datetime"><type>timestamptz</></link> are now
rendered in a string format compliant with ISO 8601 rather than the
default output format when converting to or used in
<link linkend="datatype-json"><type>JSON</type></link>.
(Andrew Dunstan)
</para>
<para>
Previously these were rendered in the default text output format
for the type, but many JSON processors require timestamps in ISO 8601
format.
</para>
</listitem>
<listitem>
<para>
Rename <link linkend="SQL-EXPLAIN"><command>EXPLAIN