X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7B824D8316 for ; Mon, 7 Nov 2005 16:42:02 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 51481-02 for ; Mon, 7 Nov 2005 20:42:00 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mailbox.samurai.com (mailbox.samurai.com [205.207.28.82]) by svr1.postgresql.org (Postfix) with ESMTP id 0168BD6805 for ; Mon, 7 Nov 2005 16:42:00 -0400 (AST) Received: from localhost (mailbox.samurai.com [205.207.28.82]) by mailbox.samurai.com (Postfix) with ESMTP id 81154239607; Mon, 7 Nov 2005 15:42:02 -0500 (EST) Received: from mailbox.samurai.com ([205.207.28.82]) by localhost (mailbox.samurai.com [205.207.28.82]) (amavisd-new, port 10024) with LMTP id 42225-01-9; Mon, 7 Nov 2005 15:42:01 -0500 (EST) Received: from [192.168.1.104] (d226-86-55.home.cgocable.net [24.226.86.55]) by mailbox.samurai.com (Postfix) with ESMTP id 12ED2239461; Mon, 7 Nov 2005 15:42:01 -0500 (EST) Subject: Re: Index + mismatching datatypes [WAS: index on custom From: Neil Conway To: weigelt@metux.de Cc: pgsql-performance@postgresql.org In-Reply-To: <20051107180738.GC15990@nibiru.local> References: <1128352451.312090.37640@g44g2000cwa.googlegroups.com> <20051006081919.GA17081@zoom.spline.inf.fu-berlin.de> <20051107180738.GC15990@nibiru.local> Content-Type: text/plain Date: Mon, 07 Nov 2005 15:45:57 -0500 Message-Id: <1131396357.6884.110.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailbox.samurai.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/123 X-Sequence-Number: 15380 On Mon, 2005-07-11 at 19:07 +0100, Enrico Weigelt wrote: > I've got a similar problem: I have to match different datatypes, > ie. bigint vs. integer vs. oid. > > Of course I tried to use casted index (aka ON (foo::oid)), but > it didn't work. Don't include the cast in the index definition, include it in the query itself: SELECT ... FROM foo WHERE int8col = 5::int8 for example. Alternatively, upgrade to 8.0 or better, which doesn't require this workaround. -Neil