Re: Bug #848: Index on bigint column is unused in selects - Mailing list pgsql-bugs

From Neil Conway
Subject Re: Bug #848: Index on bigint column is unused in selects
Date
Msg-id 1040016995.352.1.camel@tokyo
Whole thread Raw
In response to Bug #848: Index on bigint column is unused in selects  (pgsql-bugs@postgresql.org)
List pgsql-bugs
On Sat, 2002-12-14 at 15:33, pgsql-bugs@postgresql.org wrote:
> PostgreSQL 7.2 will allways do a full table scan when the index field
> is a bigint. even with a "where bigkey = 99" clause.

This is a known problem: you need to enclose the integer literal in
single quotes, or cast it to int8 for the optimizer to consider an index
scan. i.e

select * from test1 where een = '99';

Cheers,

Neil

pgsql-bugs by date:

Previous
From: Frank van Vugt
Date:
Subject: v7.3 : \encoding doesn't show changes in client encoding that are not done with \encoding itself (i.e. set names/set client_encoding)
Next
From: Robert Treat
Date:
Subject: odd behavior: function not atomic/not seeing it's own updates/not acting serializable nor read committed