dbTalk Databases Forums  

[BUGS] Integer/BigInt Implicit Typing Bug

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] Integer/BigInt Implicit Typing Bug in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pmcneill@berkleemusic.com
 
Posts: n/a

Default [BUGS] Integer/BigInt Implicit Typing Bug - 02-12-2004 , 09:06 AM






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
------------------------------------------------------------------
11111111111111111111111111111111100000000000000000 00000000000001

-Patrick McNeill

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] Integer/BigInt Implicit Typing Bug - 02-12-2004 , 10:53 AM






pmcneill (AT) berkleemusic (DOT) com writes:
Quote:
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

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.