Re: "JSON does not support infinite date values"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Tim Smith <randomdev4+postgres(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: "JSON does not support infinite date values"
Date: 2015-02-26 15:38:55
Message-ID: 32555.1424965135@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> On 2015-02-26 10:16:38 -0500, Tom Lane wrote:
>> At the same time, there is definitely no such requirement in the JSON
>> spec itself, so at least the error message is quoting the wrong
>> authority.

> To me there seems to be very little point in restricing the output that
> way. Sure, it can easily be worked around by casting before the
> conversion to json, but it's still somewhat odd to put in restrictions
> that don't exist in normal json.

Yeah, I think so. The sequence 'infinity'::timestamp to JSON to
ISO-8601-only consumer is going to fail no matter what; there is no
need for us to force a failure at the first step. Especially when
doing so excludes other, perfectly useful use-cases.

So +1 for removing the error and emitting "infinity" suitably quoted.
Andrew, will you do that?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-02-26 15:50:05 Re: Triggers Operations
Previous Message Andres Freund 2015-02-26 15:29:37 Re: "JSON does not support infinite date values"