Querying and setting a particular bit in a varying bit value

From: S P Arif Sahari Wibowo <arifsaha(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Querying and setting a particular bit in a varying bit value
Date: 2001-12-09 06:15:38
Message-ID: Pine.LNX.4.42.0112082230210.5732-100000@gede.parokinet.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

What will be the most efficient way to query the value of a certain bit in
a varying bit field, and what will be the most efficient way to replace
(set/unset) a certain bit in a varying bit field (dynamic length)?

Unfortunately the AND and OR operation require the bits have same length.

Right now the easiest way seems to use substring function, but this
function will use a lot of expensive bit shifting. Is there any better
way?

Thank you.

--
S P Arif Sahari Wibowo
_____ _____ _____ _____
/____ /____/ /____/ /____ arifsaha(at)yahoo(dot)com
_____/ / / / _____/ http://www.arifsaha.com/

Browse pgsql-general by date

  From Date Subject
Next Message Glen Eustace 2001-12-09 06:57:12 Weird problem - possibly a bug.
Previous Message Manuel Sugawara 2001-12-09 02:02:51 Re: papers on datatype design