Re: Addition and subtraction on BIT type

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Addition and subtraction on BIT type
Дата
Msg-id 20031117071700.G94696@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Addition and subtraction on BIT type  (Yasir Malik <ymalik@cs.stevens-tech.edu>)
Список pgsql-sql
On Mon, 17 Nov 2003, Yasir Malik wrote:

> Thank you for your reply.
> select int4(b'1001')::bit(32); gives the same result as what you gave.
> select int4(b'1001')::bit(4); gives the upper four bits, which are all
> zeroes.  How would I get the lower four bits?  I building bitmaps using
> plpgsql, and therefore, I will be doing a lot bit manipulation.

I think you need to use substring, probably something like:
select substring(9::bit(32) from 29 for 4);


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: strange "not deferrable" behaviour
Следующее
От: Tomasz Myrta
Дата:
Сообщение: Re: strange "not deferrable" behaviour