Re: aggregate function for median calculation

Поиск
Список
Период
Сортировка
Искать
От
Peter Eisentraut
Тема
Re: aggregate function for median calculation
Дата
Msg-id
Pine.LNX.4.30.0106192249250.724-100000@peter.localdomain
Ответ на
Список
Дерево обсуждения
aggregate function for median calculation "Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu>
Re: aggregate function for median calculation Tom Lane <tgl@sss.pgh.pa.us>
Re: aggregate function for median calculation Alex Pilosov <alex@pilosoft.com>
Re: aggregate function for median calculation Philip Hallstrom <philip@adhesivemedia.com>
Re: aggregate function for median calculation "Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu>
Re: aggregate function for median calculation "Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu>
Re: aggregate function for median calculation Peter Eisentraut <peter_e@gmx.net>
Re: aggregate function for median calculation Tom Lane <tgl@sss.pgh.pa.us>
Re: aggregate function for median calculation "Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu>
Re: aggregate function for median calculation Tom Lane <tgl@sss.pgh.pa.us>
Re: aggregate function for median calculation "Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu>
Re: aggregate function for median calculation Tom Lane <tgl@sss.pgh.pa.us>
Thalis A. Kalfigopoulos writes:

> So is there a way I can actually have a variable (the array with the elements) maintained between calls of the same function? I'm trying to figure how to design the aggregate's state_function that will do the element accumulation (before actually passing this array to the final to calculate the median).

Sure, you create a (static) global variable and reallocate memory for it
in each call and free it by the finalizer function.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter

В списке pgsql-general по дате отправления
От: Thalis A. Kalfigopoulos
Дата:
От: Thalis A. Kalfigopoulos
Дата:
Сообщение: postgres.h missing?
FAQ