Re: example of aggregate function for product

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: example of aggregate function for product
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C202FF6683@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на example of aggregate function for product  (Whit Armstrong <armstrong.whit@gmail.com>)
Список pgsql-general
Whit Armstrong wrote:
> I needed to write a product aggregate function, and just happened to
> find this example in the nodes to the 8.0 manual:
> 
[...]
> 
> but that example looks pretty different than the ones found in the 8.3
> manual (avg for instance):
> 
[...]
> 
> Are there any experts out there who have defined a product or
> cumulative product function that abides best practices who would be
> willing to share?

I don't know what "best practices" are, but the following works
fine on PostgreSQL 8.3 and 8.4:

CREATE AGGREGATE mul(double precision) (SFUNC=float8mul, STYPE=double precision, INITCOND=1);

Yours,
Laurenz Albe

В списке pgsql-general по дате отправления:

Предыдущее
От: "Albe Laurenz"
Дата:
Сообщение: Re: JDBC prepared statements & server-side prepared statements
Следующее
От: Dave Page
Дата:
Сообщение: Re: 8.4 RC1 on ubuntu 9.04 jaunty, problems after install