Re: jsonb and nested hstore

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Josh Berkus <josh(at)agliodbs(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 17:57:38
Message-ID: CAHyXU0yEKOGdJ2kb0=GYA=Puw9RwDJ4_6B9CbuvyaBwxRfyC_A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

merlin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2014-02-26 18:05:14 Re: jsonb and nested hstore
Previous Message Heikki Linnakangas 2014-02-26 17:56:44 Re: [PATCH] Use MAP_HUGETLB where supported (v3)