Re: Writing your own aggregate functions

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Writing your own aggregate functions
Дата
Msg-id CAHyXU0xFi4tX70ydo5pzi6qPxsCYhziEAdS3zdSRE8O=Q_f0Bw@mail.gmail.com
обсуждение исходный текст
Ответ на Writing your own aggregate functions  (Bastiaan Olij <bastiaan@basenlily.me>)
Список pgsql-novice
On Tue, Mar 5, 2013 at 9:44 PM, Bastiaan Olij <bastiaan@basenlily.me> wrote:
> Hiya,
>
> I was wondering if it is possible in Postgres to write an aggregate
> function?
>
> So say if I wanted to execute the following statement:
>
> select Column1, sum(Column2), myFunction(Column3)
> from MyTable
> group by Column1
>
> Could I implement myFunction as a stored function and how would I go
> about doing so?

it's trivial (and an extremely underutlized feature):
http://www.postgresql.org/docs/9.2/static/xaggr.html

merlin


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

Предыдущее
От: Bastiaan Olij
Дата:
Сообщение: Writing your own aggregate functions
Следующее
От: Victor Whiskey Yankee
Дата:
Сообщение: query on a table with an int and a vector of floating point numbers