Re: querying within json - Mailing list pgsql-sql

From Tim Dudgeon
Subject Re: querying within json
Date
Msg-id 54528FDF.6070807@gmail.com
Whole thread Raw
In response to Re: querying within json  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-sql
On 30/10/2014 16:48, David G Johnston wrote:
>>> CREATE INDEX idxgin_numeric_prop ON atable USING
>>> gin((json_col->'numeric_prop'));
>> I can add the index, but no evidence of it being used when I run a query
>> like this:
>> select * from atable where (json_col->>'numeric_prop')::numeric < 100;
> The index is storing text while the expression has been cast to numeric so,
> no, if what is shown above is exactly what you did then you would not be
> using the index.

So I tried to create the index to make it a numeric index using a cast 
(won't show the failed details) but failed.
Any suggestions on how to do this?

Tim
>
>
>
>
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/querying-within-json-tp5825042p5825055.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>




pgsql-sql by date:

Previous
From: Andreas Kretschmer
Date:
Subject: Re: return encoding results
Next
From: Filip Rembiałkowski
Date:
Subject: INT8 / float casting question