Re: Proposal: Add JSON support - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Proposal: Add JSON support
Date
Msg-id s2j603c8f071004061110p2c4449d2n24b744127dfe2330@mail.gmail.com
Whole thread Raw
In response to Re: Proposal: Add JSON support  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Proposal: Add JSON support  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Apr 6, 2010 at 1:31 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Tue, Apr 6, 2010 at 12:03 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> To me, what this throws into question is not so much whether JSON null
>>> should equate to SQL NULL (it should), but whether it's sane to accept
>>> atomic values.
>
>> With this, I disagree.  I see no reason to suppose that a JSON NULL
>> and an SQL NULL are the same thing.
>
> Oh.  If they're not the same, then the problem is easily dodged, but
> then what *is* a JSON null?

I assume we're going to treat JSON much like XML: basically text, but
with some validation (and perhaps canonicalization) under the hood.
So a JSON null will be "null", just a JSON boolean true value will be
"true".  It would be pretty weird if storing "true" or "false" or "4"
or "[3,1,4,1,5,9]" into a json column and then reading it back
returned the input string; but at the same time storing "null" into
the column returned a SQL NULL.

...Robert


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: SELECT constant; takes 15x longer on 9.0?
Next
From: Tom Lane
Date:
Subject: Re: SELECT constant; takes 15x longer on 9.0?