Skip site navigation (1) Skip section navigation (2)

Bit count

From: Nathaniel Trellice <naptrel(at)yahoo(dot)co(dot)uk>
To: pgsql-novice(at)postgresql(dot)org
Subject: Bit count
Date: 2009-11-24 15:47:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
I'd like to use an integer column (16 bits will suffice) to hold a bit-field. I'd like to be able to efficiently count the number of bits set in this field.

Is there a built-in function call I can use? (I can't find one in the manual).

If not, can anyone recommend the most efficient way within postgres to implement the kind of bit-counting tricks found at:




pgsql-novice by date

Next:From: Mladen GogalaDate: 2009-11-24 16:28:26
Subject: PostgreSQL 8.4.1 and pljava
Previous:From: richard terryDate: 2009-11-24 11:36:04
Subject: Re: Postgres blob question - insert from basic.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group