Querying and setting a particular bit in a varying bit value - Mailing list pgsql-general

From S P Arif Sahari Wibowo
Subject Querying and setting a particular bit in a varying bit value
Date
Msg-id Pine.LNX.4.42.0112082230210.5732-100000@gede.parokinet.org
Whole thread Raw
List 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@yahoo.com
_____/ /      /    / _____/       http://www.arifsaha.com/


pgsql-general by date:

Previous
From: Manuel Sugawara
Date:
Subject: Re: papers on datatype design
Next
From: Glen Eustace
Date:
Subject: Weird problem - possibly a bug.