Re: jsonb existence queries are misimplemented by jsonb_ops - Mailing list pgsql-hackers

From Tom Lane
Subject Re: jsonb existence queries are misimplemented by jsonb_ops
Date
Msg-id 4616.1399495674@sss.pgh.pa.us
Whole thread Raw
In response to jsonb existence queries are misimplemented by jsonb_ops  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: jsonb existence queries are misimplemented by jsonb_ops  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
I wrote:
> Another idea would be to change the definition of the exists operator
> so that it *does* look into sub-objects.  It seems rather random to me
> that containment looks into sub-objects but exists doesn't.  However,
> possibly there are good reasons for the non-orthogonality.

No, wait, containment *doesn't* look into sub-objects:

regression=# select * from j where f1 @> '{"foo": {"bar": "baz"}}';          f1            
-------------------------{"foo": {"bar": "baz"}}
(1 row)

regression=# select * from j where f1 @> '{"bar": "baz"}';f1 
----
(0 rows)

This is rather surprising in view of the way that section 8.14.4
goes on about nesting.  But I guess the user-facing docs for jsonb
are in little better shape than the internal docs.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: 9.4 checksum errors in recovery with gin index
Next
From: Josh Berkus
Date:
Subject: Re: proposal: Set effective_cache_size to greater of .conf value, shared_buffers