Re: bitwise and/or aggregate functions? - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: bitwise and/or aggregate functions?
Date
Msg-id Pine.LNX.4.58.0404280836130.28436@sablons.cri.ensmp.fr
Whole thread Raw
In response to Re: bitwise and/or aggregate functions?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: bitwise and/or aggregate functions?  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
> > Would it be appropriate to contribute BIT_AND and BIT_OR aggregates
>
> I am confused why you would use bit on integers

Well, (I think) I need them to manipulate pg_catalog's aclitem bitfields.
I plea not guilty for the design of pg_catalog;-)
Moreover, I added aclitem accessors which return INT4 in a recent patch
that you kindly applied.


> when there is a bit type with an AND operator:
>  pg_catalog | &    | bit        | bit        | bit         | bitwise and

Sure. "&" is also available for all integer types.
BTW, I'm arguing about AGGREGATE functions, and there is no aggregate
functions at the time, neither for int* nor for bit.

SELECT BIT_OR(aclitem_privs(...)) AS effective_privs
FROM ...
WHERE aclitem_grantee(...)=... AND ... ;


Or maybe I cannot understand why you're confused?

-- 
Fabien Coelho - coelho@cri.ensmp.fr


pgsql-hackers by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: PITR Phase 2 - Design Planning
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: bitwise and/or aggregate functions?