Render infinite date/timestamps as 'infinity' for json/jsonb
authorAndrew Dunstan
Thu, 26 Feb 2015 17:34:43 +0000 (12:34 -0500)
committerAndrew Dunstan
Thu, 26 Feb 2015 17:34:43 +0000 (12:34 -0500)
commit79afe6e66f022ea9cd6c34c334214b2fda870faa
treed721f6194460f3b4ae4cbf4c0b968b1ab30fdb68
parentd7211511270b14d992e1a064acff2d07045654e2
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.
src/backend/utils/adt/json.c
src/test/regress/expected/json.out
src/test/regress/expected/json_1.out
src/test/regress/sql/json.sql