Re: Why does postgres not take into account my index on a bigint column ?

Поиск
Список
Период
Сортировка
От Michael Loftis
Тема Re: Why does postgres not take into account my index on a bigint column ?
Дата
Msg-id 3CBB14D7.6020404@wgops.com
обсуждение исходный текст
Ответ на Why does postgres not take into account my index on a bigint column ?  ("Pierre-Andre Michel" <pamichel@geneva-link.ch>)
Список 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 по дате отправления:

Предыдущее
От: Michael Loftis
Дата:
Сообщение: Re: Why does postgres not take into account my index on a bigint column ?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Strange Update-Bug in postgres (is it a feature?) ?!