Re: OR-ing rows of bits

From: Antonio Fiol Bonnín <fiol(at)w3ping(dot)com>
To: "Thomas T(dot) Thai" <tom(at)minnesota(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: OR-ing rows of bits
Date: 2001-12-10 18:04:24
Message-ID: 3C14F928.9010304@w3ping.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas T. Thai wrote:

>what's the best way of OR-ing rows of bits or integers? SUM works for bits
>that are all atomic (1, 2, 4, 8, ...) but not for inclusive (1, 3, 7,
>...).
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
>.
>
I'd bet for a custom aggregate function.

Something like the ready-to-go statement

CREATE AGGREGATE int4or_aggregate ( BASETYPE=int4, SFUNC=int4or,
STYPE=int4 );

Hope that helps.

Antonio Fiol

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Boban Acimovic 2001-12-10 18:11:33 Re: [GENERAL] How to get database schema without pg_dump?
Previous Message Bill Cunningham 2001-12-10 17:54:03 Re: papers on datatype design