From: | Josh Berkus <josh(at)agliodbs(dot)com> |
---|---|
To: | Merlin Moncure <mmoncure(at)gmail(dot)com> |
Cc: | Hannu Krosing <hannu(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Teodor Sigaev <teodor(at)sigaev(dot)ru> |
Subject: | Re: jsonb and nested hstore |
Date: | 2014-02-26 18:05:14 |
Message-ID: | 530E2CDA.5020509@agliodbs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 02/26/2014 09:57 AM, Merlin Moncure wrote:
> On Wed, Feb 26, 2014 at 11:41 AM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
>> On 02/26/2014 07:02 AM, Merlin Moncure wrote:
>>> On Tue, Feb 25, 2014 at 3:57 PM, Hannu Krosing <hannu(at)2ndquadrant(dot)com> wrote:
>>>> It is not in any specs, but nevertheless all major imlementations do it and
>>>> some code depends on it.
>>>> IIRC, this behaviour is currently also met only by json and not by jsonb.
>>>
>>> Yes: This was the agreement that was struck and is the main reason why
>>> there are two json types, not one. JSON does not guarantee field
>>> ordering as I read the spec and for the binary form ordering is not
>>> maintained as a concession to using the hstore implementation.
>>
>> Actually, that's not true; neither Mongo/BSON nor CouchDB preserve field
>> ordering. So users who are familiar with JSONish data *storage* should
>> be aware that field ordering is not preserved.
>
> right (although I'm not sure what wasn't true there). I think the
Sorry, I was referring to Hannu's statement that "all major
implementations preserve order", which simply isn't true.
> status quo is fine; If you have to have the document precisely
> preserved for whatever reason you can do that -- you just have to be
> prepared to give up some things. As noted in the other thread
> serialization is more interesting but that also works fine. The
> breakdown in terms of usage between json/jsonb to me is very clear
> (json will handle serialization/deserializaton heavy patterns and a
> few edge cases for storage). The split between json and jsonb in
> hindsight made a lot of sense.
>
> What is not going to be so clear for users (particularly without good
> supporting documentation) is how things break down in terms of usage
> between hstore and jsonb.
Realistically? Once we get done with mapping the indexes and operators,
users who are used to Hstore1 use Hstore2, and everyone else uses jsonb.
jsonb is nothing other than a standardized syntax interface to hstore2,
and most users will choose the syntax similar to what they already know
over learning new stuff.
A real, full comparison chart would include text, json, jsonb and
hstore, I guess. Although I'm wondering if that's way too complex for
the main docs. Seems like more of a wiki item.
--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com
From | Date | Subject | |
---|---|---|---|
Next Message | Hannu Krosing | 2014-02-26 18:08:32 | Re: jsonb and nested hstore |
Previous Message | Merlin Moncure | 2014-02-26 17:57:38 | Re: jsonb and nested hstore |