Compare bit and int4 - Mailing list pgsql-novice

From Hafsteinn Þór Hafsteinsson
Subject Compare bit and int4
Date
Msg-id 5182ED915DE3D211842000600852EB953A8F7F@firebat.nervus.is
Whole thread Raw
List pgsql-novice


Hi, I need to be able to do something like this:

select * from tblTable where bField=1

and bField is defined as 'bit'. I know i can avoid getting this error:

"Unable to identify an operator '=' for types 'bit and 'int4'
 You will have to retype this query using an explicit cast"

by changing the 1 to CAST(1 as bit), but that's not an option (query
will be run on both Access and PostgreSQL).  How can i create
an operator/function to handle this automatically?

thx!

-haffi

pgsql-novice by date:

Previous
From: Stoffel van Aswegen
Date:
Subject: JDBC driver/connection
Next
From: Zavier Sheran
Date:
Subject: Upgrade from 7.0.3 to 7.1.2