Re: OR-ing rows of bits - Mailing list pgsql-general

From Antonio Fiol Bonnín
Subject Re: OR-ing rows of bits
Date
Msg-id 3C14F928.9010304@w3ping.com
Whole thread Raw
In response to OR-ing rows of bits  ("Thomas T. Thai" <tom@minnesota.com>)
List 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@postgresql.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


pgsql-general by date:

Previous
From: "Raul DAVIDOVICH"
Date:
Subject: problem with select after updating
Next
From: Frank Joerdens
Date:
Subject: Re: use BLOBS or use pointers to files on the filesystem?