Re: [HACKERS] int8 and index

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] int8 and index
Дата
Msg-id 26000.938438971@sss.pgh.pa.us
обсуждение исходный текст
Ответ на RE: [HACKERS] int8 and index  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Список pgsql-hackers
"Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> int4 -> int8 never fails.
> But int4 -> int2 fails if abs(int4) > 32768.

> select .. from .. where int2_column = 32769;

>     should return 0 rows or cause an elog(ERROR) ?

Should return 0 rows, clearly.  (That's what happens now, and I can
see no justification for doing otherwise.)  When we add code to try to
coerce the constant to match the type of the column, we will have to
watch out for overflow and not do the coercion if so.

What would be really way cool would be if the constant simplifier could
recognize that this condition is a constant FALSE, but that would
probably mean building in more knowledge about the semantics of
specific operators than is justified...
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Frustration
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] double opens