Re: count the number of bits set to 1 in a bit string field

From: Rajarshi Guha <rguha(at)indiana(dot)edu>
To: Ragnar <gnari(at)hive(dot)is>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: count the number of bits set to 1 in a bit string field
Date: 2007-07-16 13:02:56
Message-ID: A33C5957-28B2-448D-A796-B96160C2CF63@indiana.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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

-------------------------------------------------------------------
Rajarshi Guha <rguha(at)indiana(dot)edu>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
Gravity brings me down.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sim Zacks 2007-07-16 13:20:22 unconvertable characters
Previous Message Vincenzo Romano 2007-07-16 12:53:38 Re: Weird error message in SQL function call