Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XjvIb-0008IK-Sm for pgsql-sql@arkaria.postgresql.org; Thu, 30 Oct 2014 19:22:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XjvIb-00040p-DR for pgsql-sql@arkaria.postgresql.org; Thu, 30 Oct 2014 19:22:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XjvIa-00040j-N5 for pgsql-sql@postgresql.org; Thu, 30 Oct 2014 19:22:20 +0000 Received: from mail-wi0-x243.google.com ([2a00:1450:400c:c05::243]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XjvIS-000759-Vj for pgsql-sql@postgresql.org; Thu, 30 Oct 2014 19:22:19 +0000 Received: by mail-wi0-f195.google.com with SMTP id d1so2440008wiv.6 for ; Thu, 30 Oct 2014 12:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=NCKiC/5DJl5Opdtn9DBvkZxgyUDJ4AVHM5jh4Pan2l4=; b=L6/qv1ZpOINp27YCbTooRopGbgZYj9ibrci7zfOSSFrXPoBO7Gaflg/TAbpAJcGWGN ODzYcenCSEErgIe2wZyjJ0OgxnYsVo12K9qJ4etuDsZiqAchYBpS9UY0bBppbSg88bF1 03VdNf0/Gm8cUlC/qOBseiVyGaUG/eucxv8Mm6u+rAO5IhE7mObO0SVt6rEgchrg5BzT EVjvgXWGask8vZmzxGpVUSj39DDgUSPxiObHTuZ37maPJZSZEB+1CHwkuW/uHKcVxG7E n+FU9ZjnGhELhyXBYBr51T9qVYxCMI8ZAgqmxptnrQBqIf/vluZsngQ1BJgmwyLHsRml XBQA== X-Received: by 10.194.81.38 with SMTP id w6mr22725434wjx.17.1414696931399; Thu, 30 Oct 2014 12:22:11 -0700 (PDT) Received: from timbomac.home (host86-154-157-95.range86-154.btcentralplus.com. [86.154.157.95]) by mx.google.com with ESMTPSA id vm6sm9699713wjc.16.2014.10.30.12.22.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Oct 2014 12:22:10 -0700 (PDT) Message-ID: <54528FDF.6070807@gmail.com> Date: Thu, 30 Oct 2014 19:22:07 +0000 From: Tim Dudgeon User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: querying within json References: <54526655.2010306@gmail.com> <1414687726277-5825055.post@n5.nabble.com> In-Reply-To: <1414687726277-5825055.post@n5.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.6 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org 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. > > -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql