Integer/BigInt Implicit Typing Bug

Started by Nonameabout 22 years ago2 messagesbugs
Jump to latest
#1Noname
pmcneill@berkleemusic.com

In the 7.4.1 release, I've found that it implicitly types INT_MIN,
-2147483648, as a 64-bit integer instead of a 32-bit integer. Here's a test
case:

select "bit"(-2147483647);
bit
----------------------------------
10000000000000000000000000000001

select "bit"(-2147483648 + 1);
bit
------------------------------------------------------------------
1111111111111111111111111111111110000000000000000000000000000001

-Patrick McNeill

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noname (#1)
Re: Integer/BigInt Implicit Typing Bug

pmcneill@berkleemusic.com writes:

In the 7.4.1 release, I've found that it implicitly types INT_MIN,
-2147483648, as a 64-bit integer instead of a 32-bit integer.

This is not a bug, and the reason is that "-" is a separate operator.
"2147483648" is an int8 constant.

regards, tom lane