Re: index error - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: index error
Date
Msg-id 20011206080921.V25449-100000@megazone23.bigpanda.com
Whole thread Raw
In response to index error  (Hao He <Hao.He@thomson.com.au>)
List pgsql-bugs
On Thu, 6 Dec 2001, Hao He wrote:

> hi,
>
> If you create a table with one of the columns defined as int8, then the
> index created on this column does not work.  When I use explain to see
> the plan, it is always seq scan instead of index scan as one would expect.
> Other types of columns work fine (int4, string ...).

IIRC, you need to either single quote the number or explicitly cast it
into an int8 for the index to work in general, otherwise it prematurely
makes it an int4 and then doesn't use the index.  There've been
discussions about this in the past that you can get from the archives
if you're interested.

(Info about this should probably be added to the FAQ if it's
not there, it's pretty F)

pgsql-bugs by date:

Previous
From: Sandor.Vig@audi.hu
Date:
Subject: Vá: Va: [BUGS] Va: [BUGS] Bug #519: Bug in order b y clausule
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: Bug #531: libpq: Operations following PQfinish() work.