Re: "JSON does not support infinite date values" - Mailing list pgsql-general

From Andrew Dunstan
Subject Re: "JSON does not support infinite date values"
Date
Msg-id 54EF46DF.6050104@dunslane.net
Whole thread Raw
In response to Re: "JSON does not support infinite date values"  (Tim Smith <randomdev4+postgres@gmail.com>)
Responses Re: "JSON does not support infinite date values"  (Tim Smith <randomdev4+postgres@gmail.com>)
List pgsql-general
On 02/26/2015 11:03 AM, Tim Smith wrote:
> FYI.... although I remain a +1 on KISS and emitting "infinity", for
> those of you still yearning after a standards-based implementation,
> there is a StackOverflow post which hints at sections 3.5 and 3.7 of
> ISO8601:2004.
>
> Unfortunatley I can't find a link to an ISO8601:2004 text, so you'll
> have to make do with the SO quoted extracts instead....
> http://stackoverflow.com/questions/11408249/how-do-you-represent-forever-infinitely-in-the-future-in-iso8601
>


If you want to do that then store that in your date/timestamp data and
we'll output it. But we're not going to silently convert infinity to
anything else:

    andrew=# select to_json('99999-12-31'::timestamptz);
                to_json
    ------------------------------
      "99999-12-31T00:00:00-05:00"


cheers

andrew


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: "JSON does not support infinite date values"
Next
From: Tim Smith
Date:
Subject: Re: "JSON does not support infinite date values"