Thread: casting int to bit

casting int to bit

From
sad
Date:
PLEASE NOTE :

select 1::int8::bit(64);
0000000000000000000000000000000000000000000000000000000000000001

select 1::int4::bit(64);
0000000000000000000000000000000100000000000000000000000000000000

select 1::int2::bit(64);
ERROR:  Cannot cast type smallint to bit

the last is a great surprise for me !