Re: [GENERAL] JSONB Overlap Operator. - Mailing list pgsql-general

From Merlin Moncure
Subject Re: [GENERAL] JSONB Overlap Operator.
Date
Msg-id CAHyXU0wc22mACuY2H3JKV95D6q-804UM4b+xOBbBEMRGX5GwEA@mail.gmail.com
Whole thread Raw
In response to [GENERAL] JSONB Overlap Operator.  (Eduardo Felipe <edufelipe@e3c.com.br>)
List pgsql-general
On Fri, Mar 17, 2017 at 9:43 AM, Eduardo Felipe <edufelipe@e3c.com.br> wrote:
> Hi there!
>
> In a project I was experimenting with replacing array columns with JSONB
> columns, to allow a greater flexibility of types.
>
> One thing that I found missing is the "overlap" operator (&&).
>
> JSONB includes all other operators from arrays, such as containment (@>,
> <@), comparison (>, >=, <, <=) and inclusion (?). The only one missing is
> the overlap operator (&&).
>
> Does anyone know of a technical reason that operator was not included on
> JSONB?

I really miss hstore slice() (which is a function, not an operator,
but the distinction is is minor IMO) where you can pass array of keys
and get a smaller object back.  This would have to be redefined a bit
since there are new edge cases with jsonb vs hstore but it ought to be
reasonably worked out.

merlin


pgsql-general by date:

Previous
From: ibeq GmbH
Date:
Subject: [GENERAL] Why is this functional index not used?
Next
From: Guyren Howe
Date:
Subject: [GENERAL] Advice about software engineering inside Postgres?