Re: Relaxing NaN/Infinity restriction in JSON fields - Mailing list pgsql-general

From Mitar
Subject Re: Relaxing NaN/Infinity restriction in JSON fields
Date
Msg-id CAKLmikMFGy7JJFUBY7SfZxGQwy6nWY51Dt=nD7byVavjoCT0vg@mail.gmail.com
Whole thread Raw
In response to Re: Relaxing NaN/Infinity restriction in JSON fields  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Relaxing NaN/Infinity restriction in JSON fields
List pgsql-general
Hi!

On Mon, May 6, 2019 at 1:21 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Getting us to deviate from the RFC so blatantly would be a very hard sell.
> A large part of the point of the JSON datatype is to be interoperable;
> once you give that up you may as well use some not-standard-at-all
> representation.

Python supports that, enabled by default:

https://docs.python.org/3/library/json.html#infinite-and-nan-number-values

> 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.


Mitar

[1] https://tools.ietf.org/html/rfc7159#page-7

-- 
http://mitar.tnode.com/
https://twitter.com/mitar_m



pgsql-general by date:

Previous
From: Jeremy Schneider
Date:
Subject: Re: Amazon Linux Support?
Next
From: Prashant Hunnure
Date:
Subject: Postgres Database Hacked