Re: index not used for bigint without explicit cast

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Dave E Martin XXIII <postgresql-to(dot)dave(at)dave(dot)to>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: index not used for bigint without explicit cast
Date: 2003-05-27 13:56:51
Message-ID: 1054043810.93507.1.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> explain analyze select * from connection_data where id=23457;

Quote the number or cast it to int8.

id='23457' or id=cast(23457 as int8)

PostgreSQL has a hard time with mixed datatypes and indexscans at the
moment.

--
Rod Taylor <rbt(at)rbt(dot)ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Fernando Nasser 2003-05-27 14:00:06 Re: Bug #926: if old postgresql.jar in CLASSPATH, ant fails
Previous Message Tom Lane 2003-05-27 13:49:37 Re: [BUGS] Bug #928: server_min_messages (log_min_messages in CVS)