Search Postgresql Archives

Re: example of aggregate function for product

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux