Inconsistent shift operator

From: Roman Kononov <kononov(at)dls(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Inconsistent shift operator
Date: 2008-04-19 06:25:25
Message-ID: 48099055.9040607@dls.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The below test cases show the obvious inconsistency between different
integer types.

Regards,

Roman

test=# \t
Showing only tuples.
test=# select 1::int2 << 17;
0

test=# select 1::int4 << 33;
2

test=# select 1::int8 << 65;
2

test=# select 2::int2 >> 17;
0

test=# select 2::int4 >> 33;
1

test=# select 2::int8 >> 65;
1

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Roman Kononov 2008-04-19 06:36:16 BUG #4114: Inconsistent shift operator
Previous Message Javier Hernandez 2008-04-18 20:15:50 BUG #4113: server closed the connection unexpectedly