cast bit to boolean?

Поиск
Список
Период
Сортировка
От Vivek Khera
Тема cast bit to boolean?
Дата
Msg-id 15089.52410.394758.491793@onceler.kciLink.com
обсуждение исходный текст
Ответы Re: cast bit to boolean?  (Joel Burton <jburton@scw.org>)
Re: cast bit to boolean?  (Robert Hentosh <hentosh@io.com>)
Re: cast bit to boolean?  (Robert Hentosh <hentosh@io.com>)
Список pgsql-general
How might one case a BIT to a BOOLEAN?  For example, I want to return
rows which have non-zero bit representation for, say, (sel_a & b'0011').
That is, rows with the first or second bit set.

I tried an explicit CAST, and just the query directly, but the cast
say you cant cast type 'bit' to 'bool', and the direct query says
WHERE clause must return type bool, not type bit:

create table t1 (sel_a BIT(6),sel_b BIT(6));
insert into t1 values (b'000001',b'001000');
select * from t1 where sel_a & b'100001';
ERROR:  WHERE clause must return type bool, not type bit

Where might I look for this?  The manual is quite sparse regarding BIT
types.

Thanks.

В списке pgsql-general по дате отправления:

Предыдущее
От: Mike Mascari
Дата:
Сообщение: RE: MS-Query
Следующее
От: Joel Burton
Дата:
Сообщение: Metaphone function attachment