Re: Why does postgres not take into account my index on a bigint column ? - Mailing list pgsql-general

From Michael Loftis
Subject Re: Why does postgres not take into account my index on a bigint column ?
Date
Msg-id 3CBB14D7.6020404@wgops.com
Whole thread Raw
In response to Why does postgres not take into account my index on a bigint column ?  ("Pierre-Andre Michel" <pamichel@geneva-link.ch>)
List pgsql-general
Ahhhh OK I know.  I wasn't putting 2+2 together.  Time for more coffee.
 That whole discussion about unknown types on -hackers makes a boat load
more sense now.  This is a problem for me and the way an app I'm
currently writing will work (or rather will be) so I'll have to look
into it much more deeply thats for sure.



Andrew Sullivan wrote:

>On Mon, Apr 15, 2002 at 08:16:38AM -0700, Michael Loftis wrote:
>
>>IMHO this is a bug in PostgreSQL....  Ints of any type are not supposed
>>to be quoted, and whether-or-not they are shouldn't affect the planning
>>and execution of the query...
>>
>
>This is a well-known problem with bigint.  The problem is really in
>the handling of the datatype: for some reason (the details were in a
>recent thread about the issue), the values get interpreted as int4
>and there is no automatic cast to int8.
>
>When you quote the value, it gets treated as type unknown, and then
>gets cast correctly.  There's been quite a bit of discussion, ISTM,
>about how to fix it, but no consensus.
>
>>Pierre-Andre Michel wrote:
>>
>>>Hi,
>>>
>>>
>>>
>>>I noticed that postgres does not take into account index on BIGINT
>>>column when the value specified in the WHERE condition is not quoted.
>>>
>
>>>So does anybody know a way to force postgres to consider using indices
>>>on bigint columns even when the value in a where cond is not
>>>surrounded by quotes ?
>>>
>
>The alternative to quotes is to use an explicit cast.
>
>A
>



pgsql-general by date:

Previous
From: Michael Loftis
Date:
Subject: Re: Why does postgres not take into account my index on a bigint column ?
Next
From: Stephan Szabo
Date:
Subject: Re: Strange Update-Bug in postgres (is it a feature?) ?!