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);