casting int to bit

From: sad <sad(at)bankir(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: casting int to bit
Date: 2004-06-11 07:32:58
Message-ID: 200406111132.58908.sad@bankir.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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 !

Browse pgsql-sql by date

  From Date Subject
Next Message Stephen Quinney 2004-06-11 07:54:02 Re: Converting integer to binary
Previous Message Rajesh Kumar Mallah 2004-06-11 04:59:29 Re: Query becoming slower on adding a primary key [ SOLVED