Re: maxint reached? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: maxint reached?
Date
Msg-id 27814.1017781587@sss.pgh.pa.us
Whole thread Raw
In response to Re: maxint reached?  (Daniel Kalchev <daniel@digsys.bg>)
Responses Re: maxint reached?  (Daniel Kalchev <daniel@digsys.bg>)
List pgsql-hackers
Daniel Kalchev <daniel@digsys.bg> writes:
> It turned out to be an query containing "oid = somenumber" called from perl script. Is it possible that the default
typeconversion functions do not work as expected?
 

No, but you do have to cast an oversize value to oid explicitly to
prevent it from being taken as int4, eg

regression=# select oid = 2444444444 from int4_tbl;
ERROR:  dtoi4: integer out of range
regression=# select oid = 2444444444::oid from int4_tbl;
<< works >>

(In releases before about 7.1 you'd have had to single-quote the
literal, too.)

This is one of a whole raft of cases involving undesirable assignment
of types to numeric constants; see past complaints about int4 being used
where int2 or int8 was wanted, numeric vs float8 constants, etc etc.
We're still looking for a promotion rule that does what you want every
time...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Daniel Kalchev
Date:
Subject: Re: maxint reached?
Next
From: Daniel Kalchev
Date:
Subject: Re: maxint reached?