Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1454AB5DBDF for ; Wed, 6 Jul 2011 14:20:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 67260-01 for ; Wed, 6 Jul 2011 17:20:49 +0000 (UTC) X-Greylist: delayed 00:06:04.4112 by SQLgrey-1.7.6 Received: from smtp-1.01.com (smtp-1.01.com [38.102.63.180]) by mail.postgresql.org (Postfix) with ESMTP id A8135B5DBDA for ; Wed, 6 Jul 2011 14:20:49 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-1.01.com (Postfix) with ESMTP id B288B36420B for ; Wed, 6 Jul 2011 12:14:43 -0500 (CDT) Received: from smtp-1.01.com ([127.0.0.1]) by localhost (smtp-1.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id umSY-3-0NahX for ; Wed, 6 Jul 2011 12:14:43 -0500 (CDT) Received: by smtp-1.01.com (Postfix, from userid 99) id 2127536410E; Wed, 6 Jul 2011 12:14:43 -0500 (CDT) Received: from [10.10.10.5] (8.202-62-69.ftth.swbr.surewest.net [69.62.202.8]) by smtp-1.01.com (Postfix) with ESMTPSA id 7E82136411D; Wed, 6 Jul 2011 12:14:42 -0500 (CDT) Message-ID: <4E149801.40507@pgexperts.com> Date: Wed, 06 Jul 2011 10:14:41 -0700 From: Jeff Frost Organization: PostgresSQL Experts, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs@postgresql.org Subject: Re: BUG #6092: specific casting required for gist indexing of bigint References: <201107052343.p65NhoKD055167@wwwmaster.postgresql.org> <2786.1309910771@sss.pgh.pa.us> In-Reply-To: <2786.1309910771@sss.pgh.pa.us> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201107/48 X-Sequence-Number: 30660 On 07/05/11 17:06, Tom Lane wrote: > "Jeff Frost" writes: >> Ran into a situation with a customer who is using the btree_gist contrib >> module to allow combined index of some tsearch data and two other columns. >> One of these other columns is a bigint field. I noticed that the combined >> index won't be used by the planner unless you specifically cast the bare >> number to a bigint. > If memory serves, the btree_gist opclasses don't include any cross-type > operators, so "int8 = int4" doesn't work here. > Ah! And if you look at the contrib/btree_gist/sql/int8.sql test file, you'll see this: SELECT count(*) FROM int8tmp WHERE a < 464571291354841::int8; So, I'd say it's expected behavior even though it's slightly counter intuitive if you're used to the auto typing behavior.