pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Conway <neilc@samurai.com>
To: weigelt@metux.de
Cc: pgsql-performance@postgresql.org
Subject: Re: Index + mismatching datatypes [WAS: index on custom
Date: Mon, 07 Nov 2005 15:45:57 -0500
Message-ID: <1131396357.6884.110.camel@localhost.localdomain> (raw)
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>

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





view thread (2+ messages)

Message-ID: <1131396357.6884.110.camel@localhost.localdomain>
Permalink:  ../1131396357.6884.110.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1131396357.6884.110.camel@localhost.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: neilc@samurai.com, weigelt@metux.de
  Subject: Re: Index + mismatching datatypes [WAS: index on custom
  In-Reply-To: <1131396357.6884.110.camel@localhost.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox