On Wed, May 7, 2014 at 12:08 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> * Jsonb Keys and string array elements are treated equivalently when
> * serialized to text index storage. One day we may wish to create an opclass
> * that only indexes values, but for now keys and values are stored in GIN
> * indexes in a way that doesn't really consider their relationship to each
> * other.
>
> Is this an obsolete speculation about writing jsonb_hash_ops, or is there
> still something worth preserving there? If so, what?
This is not obsolete. It would equally apply to a GiST opclass that
wanted to support our current definition of existence. Array elements
are keys simply by virtue of being strings, but otherwise are treated
as values. See the large comment block within gin_extract_jsonb().
--
Peter Geoghegan