From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Andrew Gould <andrewgould(at)yahoo(dot)com> |
Cc: | Postgres Mailing List <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: requesting features in PostgreSQL |
Date: | 2002-04-26 15:19:07 |
Message-ID: | 26359.1019834347@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Andrew Gould <andrewgould(at)yahoo(dot)com> writes:
> I need an aggregate function that calculates geometric
> mean, and can be used in SQL statements the same as
> any other aggregate function such as count(), sum()
> and avg(). Rather than have a custom function, I'd
> like to see it added as a standard PostgreSQL feature.
One request does not strike me as sufficient reason to make it a
standard feature. Extensibility is what Postgres is all about
--- so go ahead and write your own.
AFAICS this should take about ten minutes to prototype (two simple
plpgsql or pltcl functions and a user-defined aggregate). If you intend
to process very large volumes of data, it might be worth rewriting the
transition function in C for speed. (You could steal the existing
transition function for avg() as a model.)
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | fathi.engineer | 2002-04-26 15:20:28 | Pam Authentication help needed |
Previous Message | Robert J. Sanford, Jr. | 2002-04-26 15:12:13 | Re: odd psql behaviour on OSX |