[SQL] Efficiently determining the number of bits set in the contents of a VARBIT field

2008-07-26 Thread Allan Kamau
Hi all, Am looking for a fast and efficient way to count the number of bits set (to 1) in a VARBIT field. I am currently using "LENGTH(REGEXP_REPLACE(CAST(a.somefield_bit_code AS TEXT),'0','','g'))". Allan. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] Select default values

2008-07-26 Thread Giorgio Valoti
On 24/lug/08, at 23:15, Richard Broersma wrote: On Thu, Jul 24, 2008 at 12:35 PM, Giorgio Valoti <[EMAIL PROTECTED]> wrote: Um - there is no default value for a function. Without this "feature" you have to overload the function arguments. You could pass a casted null to the function. T