]> granicus.if.org Git - postgresql/commit
Render infinite date/timestamps as 'infinity' for json/jsonb
authorAndrew Dunstan <andrew@dunslane.net>
Thu, 26 Feb 2015 17:25:21 +0000 (12:25 -0500)
committerAndrew Dunstan <andrew@dunslane.net>
Thu, 26 Feb 2015 17:25:21 +0000 (12:25 -0500)
commitbda76c1c8cfb1d11751ba6be88f0242850481733
treede3272dade43151c7f9668e18cb8111f2da70bb6
parentfd6a3f3ad4067f1b8fc28e9de6e99e5936d82161
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/backend/utils/adt/jsonb.c
src/test/regress/expected/json.out
src/test/regress/expected/json_1.out
src/test/regress/expected/jsonb.out
src/test/regress/expected/jsonb_1.out
src/test/regress/sql/json.sql
src/test/regress/sql/jsonb.sql