Re: bitwise and/or aggregate functions?

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bitwise and/or aggregate functions?
Date: 2004-04-28 06:46:09
Message-ID: Pine.LNX.4.58.0404280836130.28436@sablons.cri.ensmp.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)cri(dot)ensmp(dot)fr

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-04-28 07:07:59 Re: bitwise and/or aggregate functions?
Previous Message Bruno Wolff III 2004-04-28 06:30:04 Re: PITR Phase 2 - Design Planning