pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: Render infinite date/timestamps as 'infinity' for json/jsonb
Date: Thu, 26 Feb 2015 17:35:27 +0000
Message-ID: <E1YR2LP-0003OL-UL@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Render infinite date/timestamps as 'infinity' for json/jsonb

Commit ab14a73a6c raised an error in these cases and later the
behaviour was copied to jsonb. This is what the XML code, which we
then adopted, does, as the XSD types don't accept infinite values.
However, json dates and timestamps are just strings as far as json is
concerned, so there is no reason not to render these values as
'infinity'.

The json portion of this is backpatched to 9.4 where the behaviour was
introduced. The jsonb portion only affects the development branch.

Per gripe on pgsql-general.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/79afe6e66f022ea9cd6c34c334214b2fda870faa

Modified Files
--------------
src/backend/utils/adt/json.c         |   43 +++++++++++++++++-----------------
src/test/regress/expected/json.out   |   24 +++++++++++++++++++
src/test/regress/expected/json_1.out |   24 +++++++++++++++++++
src/test/regress/sql/json.sql        |    6 +++++
4 files changed, 76 insertions(+), 21 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (2+ messages)

Message-ID: <E1YR2LP-0003OL-UL@gemulon.postgresql.org>
Permalink:  ../E1YR2LP-0003OL-UL@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1YR2LP-0003OL-UL@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andrew@dunslane.net
  Subject: Re: pgsql: Render infinite date/timestamps as 'infinity' for json/jsonb
  In-Reply-To: <E1YR2LP-0003OL-UL@gemulon.postgresql.org>
  References: <E1YR2LP-0003OL-UL@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox