Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 25DB7B5DBF0 for ; Wed, 6 Jul 2011 16:17:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 81624-10 for ; Wed, 6 Jul 2011 19:16:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 959D9B5DBE9 for ; Wed, 6 Jul 2011 16:16:59 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p66JGjpB025124; Wed, 6 Jul 2011 15:16:45 -0400 (EDT) To: Jeff Frost cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6092: specific casting required for gist indexing of bigint In-reply-to: <4E149801.40507@pgexperts.com> References: <201107052343.p65NhoKD055167@wwwmaster.postgresql.org> <2786.1309910771@sss.pgh.pa.us> <4E149801.40507@pgexperts.com> Comments: In-reply-to Jeff Frost message dated "Wed, 06 Jul 2011 10:14:41 -0700" Date: Wed, 06 Jul 2011 15:16:45 -0400 Message-ID: <25123.1309979805@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201107/52 X-Sequence-Number: 30664 Jeff Frost writes: > 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. Well, it might be nice to fix it sometime, but I'd characterize it as an unimplemented feature in btree_gist, not a bug. regards, tom lane