Skip site navigation (1) Skip section navigation (2)

BUG #5237: strange int->bit and bit->int conversions

From: "Roman Kononov" <kononov(at)ftml(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5237: strange int->bit and bit->int conversions
Date: 2009-12-09 20:06:19
Message-ID: (view raw or flat)
Lists: pgsql-bugspgsql-hackers
The following bug has been logged online:

Bug reference:      5237
Logged by:          Roman Kononov
Email address:      kononov(at)ftml(dot)net
PostgreSQL version: 8.4.1
Operating system:   GNU/Linux x86_64
Description:        strange int->bit and bit->int conversions

test=# select (11::int4<<23 | 11::int4)::bit(32);

test=# select (11::int4<<23 | 11::int4)::bit(33);

test=# select (11::int4<<23 | 11::int4)::bit(39);

test=# select (11::int4<<23 | 11::int4)::bit(40);

The ::bit(33) and ::bit(39) conversions seem wrong.

test-std=# select 1::int4::bit(32)::int4;

test-std=# select 1::int4::bit(33)::int4;
ERROR:  integer out of range

Why is it out of range?


pgsql-hackers by date

Next:From: Robert HaasDate: 2009-12-09 21:06:08
Subject: Re: explain output infelicity in psql
Previous:From: Andrew DunstanDate: 2009-12-09 19:37:49
Subject: explain output infelicity in psql

pgsql-bugs by date

Next:From: Daniel NagyDate: 2009-12-09 21:12:08
Subject: BUG #5238: frequent signal 11 segfaults
Previous:From: Mike LandisDate: 2009-12-09 19:35:56
Subject: getting libpqd.lib and libpqd.dll for postgesql 8.4.1 on Vista with VS8 or cygwin g++

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group