Re: Aggregate binary AND

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Aggregate binary AND
Дата
Msg-id 23007.1004641279@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Aggregate binary AND  ("James Orr" <james@lrgmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: How to use BYTEA type?
Следующее
От: "Sandro Joel Eller"
Дата:
Сообщение: Error 34526 - cache lookup failed