On Thu, 16 Jan 2003, Roman Fail wrote:
>
> HOWEVER.....look at this:
> EXPLAIN ANALYZE select batchdetailid from batchdetail where batchdetailid = 27321::bigint;
> Index Scan using batchdetail_pkey on batchdetail (cost=0.00..4.13 rows=1 width=8) (actual time=0.03..0.03 rows=1
loops=1)
> Index Cond: (batchdetailid = 27321::bigint)
> Total runtime: 0.07 msec
>
We had this happen to us - we had a serial8 column (int8) and our query
was straight forward where id = 12345; which ran craptacularly. After
much head banging and cursing I had tried where id = '12345' and it
magically worked. I think the parser is interpreting a "number" to be an
int4 instead of int8. (instead of quotes you can also cast via
12345::int8 like you did)
Perhaps this should go on the TODO - when one side is an int8 and the
other is a literal number assume the number to be int8 instead of int4?
------------------------------------------------------------------------------
Jeff Trout <jeff@jefftrout.com> http://www.jefftrout.com/
Ronald McDonald, with the help of cheese soup,
controls America from a secret volkswagon hidden in the past
-------------------------------------------------------------------------------