Re: jsonb and nested hstore

From: Thom Brown <thom(at)linux(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Teodor Sigaev <teodor(at)sigaev(dot)ru>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb and nested hstore
Date: 2014-02-28 13:02:57
Message-ID: CAA-aLv4qAz2H5dcUrP8N-YksqjrE-B2Z10arxjHrWa7yS0OhOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 28 February 2014 13:01, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:

>
> On 02/28/2014 07:19 AM, Thom Brown wrote:
>
> On 28 February 2014 08:12, Andres Freund <andres(at)2ndquadrant(dot)com <mailto:
>> andres(at)2ndquadrant(dot)com>> wrote:
>>
>> On 2014-02-27 15:06:33 -0500, Andrew Dunstan wrote:
>> > You realize that this API dates from 9.3 and has been used in
>> numerous
>> > extensions, right? So the names are pretty well fixed, for good
>> or ill.
>>
>> Sure. Doesn't prevent adding a couple more comments tho. I've only
>> noticed this because I opened the header as a reference when reading
>> your patch. Anyway, do something based on that feedback or not, your
>> choice ;)
>>
>>
>> Can I ask why I can do this:
>>
>> SELECT review %> 'product'->'title' as product_title
>> FROM rating;
>>
>> But I can't do this:
>>
>> SELECT review->'product'->'title' as product_title
>> FROM rating;
>>
>> ERROR: operator does not exist: hstore -> hstore
>> LINE 1: explain select review -> 'product'::hstore ->'title' as prod...
>>
>> Yet I can do this:
>>
>> SELECT review::json->'product'->'title' as product_title
>> FROM rating;
>>
>>
>>
> I don't think this complaint has anything to do with the text you quoted,
> so you've kinda hijacked the thread slightly.
>

Apologies. I'd just given the patches my first test-drive and replied to
the last message on the thread.

> But anyway, I think we've seen enough of these to conclude that the casts
> from hstore to jsonb and back should not be implicit. I am fairly confident
> that changing that would fix your complaint and the similar one that Peter
> Geoghegan had.

Thanks.
--
Thom

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ali Piroozi 2014-02-28 13:06:01 Equivalence Rules
Previous Message Michael Paquier 2014-02-28 13:01:22 Re: Request improve pg_stat_statements module