Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id A151DB5DBF0 for ; Tue, 5 Jul 2011 21:06:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 16938-02 for ; Wed, 6 Jul 2011 00:06:19 +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 6C7D9B5DBE6 for ; Tue, 5 Jul 2011 21:06:19 -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 p6606BgJ002787; Tue, 5 Jul 2011 20:06:11 -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: <201107052343.p65NhoKD055167@wwwmaster.postgresql.org> References: <201107052343.p65NhoKD055167@wwwmaster.postgresql.org> Comments: In-reply-to "Jeff Frost" message dated "Tue, 05 Jul 2011 23:43:50 +0000" Date: Tue, 05 Jul 2011 20:06:11 -0400 Message-ID: <2786.1309910771@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/43 X-Sequence-Number: 30655 "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. regards, tom lane