Re: hstore - jsonb

From: Oleg Bartunov <obartunov(at)gmail(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Armand Turpel <armand(dot)turpel(dot)mnhn(at)gmail(dot)com>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: hstore - jsonb
Date: 2014-04-04 15:15:29
Message-ID: CAF4Au4x+7UB2K2aGqOBUDqQtF-OK_0Y+HdRnUq69B=4gXmtrMg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

We'll work on contrib/jsonxtra with all operators ported from hstore
and release it after 9.4 as separate extension.

On Fri, Apr 4, 2014 at 4:32 PM, Thom Brown <thom(at)linux(dot)com> wrote:
> On 4 April 2014 13:04, Oleg Bartunov <obartunov(at)gmail(dot)com> wrote:
>> On Fri, Apr 4, 2014 at 12:20 PM, Armand Turpel
>> <armand(dot)turpel(dot)mnhn(at)gmail(dot)com> wrote:
>>> Hi,
>>>
>>> A few questions about jsonb and hstore:
>>>
>>> 1. does jsonb replace hstore?
>>
>> no, it's different data type
>>
>>> 2. compatibility of jsonb <> hstore?
>>
>> hstore is a simple key-value model, while jsonb - richer document-based model.
>>
>>> 3. will the development of hstore continue?
>>
>> I don't believe so, we froze nested hstore to concentrate development
>> resources to jsonb. Nested hstore still available from
>> http://www.sigaev.ru/git/gitweb.cgi?p=hstore.git;a=summary
>> It's should be compatible with 9.3
>>
>>
>>> 4. is it recommended to use jsonb when planning new projects?
>>
>> yes, we are working on jsonb support.
>
> One major advantage of hstore over json/jsonb at the moment is data
> manipulation, which could make json/jsonb a non-starter for some.
>
> For example, in hstore one can do:
>
> -- remove a key/value pair by key
> UPDATE mytable SET hcolumn = hcolumn - 'mykey'::text;
>
> or:
>
> -- remove a key/value pair by key/value
> UPDATE mytable SET hcolumn = hcolumn - 'mykey=>myvalue'::hstore;
>
> or:
>
> -- add/replace a key/value pair
> UPDATE mytable SET hcolumn = hcolumn || 'newkey=>newvalue'::hstore;
>
>
> You can't do something like that with json/jsonb at the moment, and
> that's not going to be possible in the upcoming version either. You'd
> probably have to resort to application-side modification, or use
> something like pl/v8.
>
> --
> Thom

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2014-04-04 15:17:45 Re: hstore - jsonb
Previous Message Kohler Manuel (ID SIS) 2014-04-04 15:14:44 Re: Indices and Foreign Tables