Re: requesting features in PostgreSQL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: requesting features in PostgreSQL
Дата
Msg-id 26359.1019834347@sss.pgh.pa.us
обсуждение исходный текст
Ответ на requesting features in PostgreSQL  (Andrew Gould <andrewgould@yahoo.com>)
Ответы Re: requesting features in PostgreSQL  (Andrew Gould <andrewgould@yahoo.com>)
Список pgsql-general
Andrew Gould <andrewgould@yahoo.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

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

Предыдущее
От: "Robert J. Sanford, Jr."
Дата:
Сообщение: Re: odd psql behaviour on OSX
Следующее
От: "Dominic J. Eidson"
Дата:
Сообщение: Re: Pam Authentication help needed