Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP) - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)
Date
Msg-id 4CBF2634.80107@dunslane.net
Whole thread Raw
In response to Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)  (Florian Weimer <fw@deneb.enyo.de>)
List pgsql-hackers

On 10/20/2010 01:15 PM, Florian Weimer wrote:
> * Terry Laurenzo:
>
>> Agreed.  BSON was born out of implementations that either lacked
>> arbitrary precision numbers or had a strong affinity to an
>> int/floating point way of thinking about numbers.  I believe that if
>> BSON had an arbitrary precision number type, it would be a proper
>> superset of JSON.
> But JSON has only double-precision numbers!?

AFAICT the JSON spec says nothing at all about the precision of numbers. 
It just provides a syntax for them. We should not confuse what can be 
allowed in JSON with what can be handled by some consumers of JSON such 
as ECMAScript.

However, since we would quite reasonably require that any JSON 
implementation be able to handle arbitrary precision numbers, that 
apparently rules out BSON as a storage engine for it, since BSON can not 
handle such things.


cheers

andrew


pgsql-hackers by date:

Previous
From: Florian Weimer
Date:
Subject: Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)
Next
From: Aidan Van Dyk
Date:
Subject: Re: pg_rawdump