Re: Aggregate binary AND - Mailing list pgsql-sql

From Tom Lane
Subject Re: Aggregate binary AND
Date
Msg-id 23007.1004641279@sss.pgh.pa.us
Whole thread Raw
In response to Aggregate binary AND  ("James Orr" <james@lrgmail.com>)
List pgsql-sql
"James Orr" <james@lrgmail.com> writes:
> Is there an aggregate binary AND function in postgres?  If not, is there a
> way to write your own aggregate functions?  Examples?

The aggregate would be trivial given an underlying two-argument AND
function to build it from:

regression=# create aggregate booland ( basetype = bool,
regression(# sfunc = booland, stype = bool,
regression(# initcond = 'true' );
ERROR:  AggregateCreate: function 'booland(bool, bool)' does not exist

Unfortunately, it seems no one has bothered to create a functional form
of AND (the keyword-AND operator isn't a function).  I'll leave that
part as an exercise for the student ...
        regards, tom lane


pgsql-sql by date:

Previous
From: Joe Conway
Date:
Subject: Re: How to use BYTEA type?
Next
From: "Sandro Joel Eller"
Date:
Subject: Error 34526 - cache lookup failed