Shouldn't B'1' = 1::bit be true? - Mailing list pgsql-general

From Bill Moran
Subject Shouldn't B'1' = 1::bit be true?
Date
Msg-id 4046514A.5010809@potentialtech.com
Whole thread Raw
Responses Re: Shouldn't B'1' = 1::bit be true?
Re: Shouldn't B'1' = 1::bit be true?
List pgsql-general
Am I missing something here?

agelis=# select B'1'::int;
  int4
------
     1
(1 row)

agelis=# select 1::bit;
  bit
-----
  0
(1 row)

agelis=# select B'1'=1;
  ?column?
----------
  f
(1 row)

Last I checked, binary 1 and integer 1 were equal.  Is this a bug, or is there
a reason for this that I need educated on?  Why does int 1 cast to binary 0?

This is Posgres 7.4.1.

--
Bill Moran
Potential Technologies
http://www.potentialtech.com


pgsql-general by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: Question on stored functions
Next
From: mbc@soliton.com
Date:
Subject: clarification of postgres limitations