Re: BUG #2006: queryoptimizer and comparing a primary key of biginteger and a literal - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2006: queryoptimizer and comparing a primary key of biginteger and a literal
Date
Msg-id 2526.1130515940@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2006: queryoptimizer and comparing a primary key of biginteger and a literal  ("Atanas Hristov" <atanashristov@hotmail.com>)
List pgsql-bugs
"Atanas Hristov" <atanashristov@hotmail.com> writes:
> foo=# EXPLAIN ANALYZE SELECT 'foo' FROM foo WHERE id = 0; -- WHY POSTGRES
> DOES NOT IMPLICITLY DO CASTING OF THE LITERAL "0" ??????

It works for me:

regression=# EXPLAIN ANALYZE SELECT 'foo' FROM foo WHERE id = 0;
                                                 QUERY PLAN
------------------------------------------------------------------------------------------------------------
 Index Scan using foo_pk on foo  (cost=0.00..4.82 rows=1 width=0) (actual time=0.241..0.241 rows=0 loops=1)
   Index Cond: (id = 0)
 Total runtime: 0.456 ms
(3 rows)

I don't think you're really testing 8.1.  Try "select version()"

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Henning"
Date:
Subject: BUG #2004: SQL_COLUMN_AUTO_INCREMENT & SQL_DESC_AUTO_UNIQUE_VALUE not working
Next
From: Richard Huxton
Date:
Subject: Re: BUG #2006: queryoptimizer and comparing a primary key