![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all, is it the behaviour shown below normal? I mean, why 1::int << 32 and 1::bigint << 64 gives 1 instead to return an error? db_atm=# select (1::bigint << 64)-1 as test; test ------ 0 (1 row) db_atm=# select (1::bigint << 63)-1 as test; ERROR: bigint out of range db_atm=# select (1::bigint << 62)-1 as test; test --------------------- 4611686018427387903 (1 row) db_atm=# select (1::int << 32)-1 as test; test ------ 0 (1 row) db_atm=# select (1::int << 31)-1 as test; ERROR: integer out of range db_atm=# select (1::int << 30)-1 as test; test ------------ 1073741823 (1 row) |
![]() |
| Thread Tools | |
| Display Modes | |
| |