Compare bit and int4

Поиск
Список
Период
Сортировка
Искать

Compare bit and int4

От:
Hafsteinn Þór Hafsteinsson <hafsteinn@nervus.is>
Дата:


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

FAQ