Re: [GENERAL] jsonb and comparison operators

2014-09-03 Thread Oleg Bartunov
jsquery (https://github.com/akorotkov/jsquery) should works for you. On Wed, Sep 3, 2014 at 8:38 AM, Joe Van Dyk wrote: > Is it possible to get this query (or a similar one) to use an index? > > I want to return all rows that have a value of less than 10. I have > arbitrary keys I want to check

Re: [GENERAL] jsonb and comparison operators

2014-09-02 Thread Joe Van Dyk
On Tue, Sep 2, 2014 at 9:55 PM, Peter Geoghegan wrote: > On Tue, Sep 2, 2014 at 9:38 PM, Joe Van Dyk 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 w

Re: [GENERAL] jsonb and comparison operators

2014-09-02 Thread Peter Geoghegan
On Tue, Sep 2, 2014 at 9:38 PM, Joe Van Dyk 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

[GENERAL] jsonb and comparison operators

2014-09-02 Thread Joe Van Dyk
Is it possible to get this query (or a similar one) to use an index? 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'). drop table if exists test; create table test (j jsonb); insert into test select json_build_object('a', i)::json