On Jul 15, 2007, at 7:20 PM, Ragnar wrote:
On sun, 2007-07-15 at 15:35 -0400, Rajarshi Guha wrote:
Hi, is there a built in function that will give me the number of bits
that are set to 1 in a bit string field?
no, but it should be trivial to do with pl/pgsql
Thanks for the pointer
---
Hi,
I don't quite know what you mean by a "bit string field" but for any
numeric, better integer row can use the following construct:
Say the bits you where testing where bit 3 ('0100' bit),
and bit 6 ('0010' bit) of say some_integer row
then this would do it:
select
sum(case whe
On sun, 2007-07-15 at 15:35 -0400, Rajarshi Guha wrote:
> Hi, is there a built in function that will give me the number of bits
> that are set to 1 in a bit string field?
no, but it should be trivial to do with pl/pgsql
a naive implementation could be:
create or replace function bitsetlen(bit)
Hi, is there a built in function that will give me the number of bits
that are set to 1 in a bit string field?
Thanks,
---
Rajarshi Guha <[EMAIL PROTECTED]>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE