Re: index error

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Hao He <Hao(dot)He(at)thomson(dot)com(dot)au>
Cc: "'pgsql-bugs(at)postgresql(dot)org'" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: index error
Date: 2001-12-06 16:13:46
Message-ID: 20011206080921.V25449-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2001-12-06 18:35:49 Bug #531: libpq: Operations following PQfinish() work.
Previous Message jayesh tank 2001-12-06 11:35:04 Fwd: Error while inserting long string in database table.