Skip site navigation (1) Skip section navigation (2)

Re: BUG #2006: queryoptimizer and comparing a primary key of biginteger and a literal

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Atanas Hristov" <atanashristov(at)hotmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2006: queryoptimizer and comparing a primary key of biginteger and a literal
Date: 2005-10-28 16:12:20
Message-ID: 2526.1130515940@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Atanas Hristov" <atanashristov(at)hotmail(dot)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

In response to

pgsql-bugs by date

Next:From: Richard HuxtonDate: 2005-10-28 16:29:18
Subject: Re: BUG #2006: queryoptimizer and comparing a primary key
Previous:From: Antonio Pedro LopesDate: 2005-10-28 12:59:43
Subject: BUG #2008: IUSR (Internet Guest Account) - ADO Connection problems IUSR missing permissions.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group