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