Re: ERROR: int8 conversion to int4 is out of range

Поиск
Список
Период
Сортировка
От Colin Campbell
Тема Re: ERROR: int8 conversion to int4 is out of range
Дата
Msg-id Pine.BSF.4.33.0108301029440.25194-100000@guru.citec.qld.gov.au
обсуждение исходный текст
Ответы Re: ERROR: int8 conversion to int4 is out of range  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi,

Fixed it. (If anyone cares :-) Seems it might be a gcc optimizer
"feature".

The code in backend/utils/adt/int8.c was:

        if ((val < (int64)INT_MIN) || (val > (int64)INT_MAX))
                elog(ERROR, "int8 conversion to int4 is out of range");

If I changed it to

        if ((val < INT_MIN))
                elog(ERROR, "int8 conversion to int4 is out of range - too small");
        if ((val > INT_MAX))
                elog(ERROR, "int8 conversion to int4 is out of range - too big");

the error went away.

Colin


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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: RFC: PostgreSQL and MySQL comparison.
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: Default encoding in database