Thread: Compare bit and int4

Compare bit and int4

From
Hafsteinn Þór Hafsteinsson
Date:


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