Re: Aggregate binary AND

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "James Orr" <james(at)lrgmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Aggregate binary AND
Date: 2001-11-01 19:01:19
Message-ID: 23007.1004641279@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"James Orr" <james(at)lrgmail(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-11-01 19:38:56 Re: Error 34526 - cache lookup failed
Previous Message Sandro Joel Eller 2001-11-01 18:49:01 Error 34526 - cache lookup failed