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
обсуждение исходный текст
Ответ на 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>)
Список pgsql-general
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
(beforeactually 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"
Дата:
Сообщение: Re: aggregate function for median calculation
Следующее
От: "Thalis A. Kalfigopoulos"
Дата:
Сообщение: postgres.h missing?