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

From: Colin Campbell <sgcccdc(at)citec(dot)qld(dot)gov(dot)au>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: ERROR: int8 conversion to int4 is out of range
Date: 2001-08-30 00:40:48
Message-ID: Pine.BSF.4.33.0108301029440.25194-100000@guru.citec.qld.gov.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tatsuo Ishii 2001-08-30 00:58:04 Re: Default encoding in database
Previous Message Martijn van Oosterhout 2001-08-30 00:25:58 Re: RFC: PostgreSQL and MySQL comparison.