Re: "JSON does not support infinite date values"

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


On 02/26/2015 07:02 AM, Andres Freund wrote:
> Hi,
>
> On 2015-02-26 11:55:20 +0000, Tim Smith wrote:
>> As far as I'm aware, JSON has no data types as such, and so why is
>> Postgres (9.4.1) attempting to impose its own nonsense constraints ?
> "impose its own nonsense constraints" - breathe slowly in, and out, in,
> and out.
>
> It looks to me like ab14a73a6ca5cc4750f0e00a48bdc25a2293034a copied too
> much code from xml.c - including a comment about XSD... Andrew, was that
> intentional?
>

Possibly too much was copied, I don't recall a reason offhand for
excluding infinity. I'm not opposed to changing it (jsonb will have the
same issue). We do allow infinity (and NaN etc) when converting numerics
to json, so perhaps doing it for dates and timestamps too would be more
consistent.

cheers

andrew

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2015-02-26 15:08:05 Re: Locking question
Previous Message Adrian Klaver 2015-02-26 14:45:35 Re: "JSON does not support infinite date values"