Re: jsonb and comparison operators

From: Joe Van Dyk <joe(at)tanga(dot)com>
To: Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: jsonb and comparison operators
Date: 2014-09-03 05:06:45
Message-ID: CACfv+pK8HC0awrr8sUofoJN6Jko1WQKkP85kh5UZwTpLaHaMPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 2, 2014 at 9:55 PM, Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com
> wrote:

> On Tue, Sep 2, 2014 at 9:38 PM, Joe Van Dyk <joe(at)tanga(dot)com> wrote:
> > I want to return all rows that have a value of less than 10. I have
> > arbitrary keys I want to check (not just 'a').
>
>
> If you created an expression B-Tree index on 'a' it would work for
> 'a', but you'd have to use a jsonb literal, not a json/int4 literal.
> If you want to be able to query every key at the top nesting level of
> an object, such that all rows are returned with jsonbs that have
> object values of which in each case one of them is, say, below 10,
>

Just a particular key specified in the query, not just any of them.

I may want key 'a' one time, and 'b' the next time. Not sure if that's what
you meant.

I figured since I could do equality, I should be able to do less than and
greater than.

Joe

> then that's something that no existing opclass can support. But, why
> should it be supported? That's a very fuzzy criteria to search on.
>
> --
> Regards,
> Peter Geoghegan
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2014-09-03 08:14:36 Re: jsonb and comparison operators
Previous Message Peter Geoghegan 2014-09-03 04:55:46 Re: jsonb and comparison operators