Re: Relaxing NaN/Infinity restriction in JSON fields

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Mitar <mmitar(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Relaxing NaN/Infinity restriction in JSON fields
Date: 2019-05-08 13:09:37
Message-ID: 20190508130937.GA6216@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2019-May-07, Mitar wrote:

> On Mon, May 6, 2019 at 1:21 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> > There is not, and never has been, any claim that JSON numbers correspond
> > to the IEEE spec.
>
> There is note [1], but yes, it does not claim that nor I claimed that.
> I am just saying that the reality is that most people these days use
> IEEE spec floating numbers so it is sad that those cannot be easily
> stored in JSON, or a database.

If you want to complain about JSON, it's IETF that you need to talk
about, not us -- we're just implementing their spec. As for storing the
numbers in a database, you can already do that, just not on the JSON
datatype.

There is a lot of talk in the json mailing list about subnormals and why
they don't want them valid in JSON because of interoperability, and that
discussion led to the wording present in RFC7159; strangely, the wording
there about Inf/NaN predates that discussion (it's already there in
RFC4627) and I couldn't find the rationale for they being disallowed.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Imre Samu 2019-05-08 13:27:16 Re: Postgres Database Hacked
Previous Message Prashant Hunnure 2019-05-08 10:42:03 Postgres Database Hacked