Could you do an explain analyze of both of these statements? It may help in
understanding the issue.
If it's a primary key, I assume the first query to be using the primary key
index.
The second variant will probably be a sequential scan on the table.
If these give different results, it may be a corrupt index, you could try
to reindex the specific index or the table, see
http://www.postgresql.org/docs/9.1/static/sql-reindex.html