I really need a Standard Deviation aggregate function so I will
try to write one.
I know about the man pages for "create aggregate" and "create
function". Is there something else I should look at?
Just a few pointers could save me a few hours of hunting around.
All advice accepted.
It seems kind of hard to do with only two state functions unless
I "cheat". I need to keep three values, Count, Sum, and Sum of
Squares. I could use three static variables and have the final
function ignore its input and use the static vars instead. This
will likely blow up if the new Standard Deviation aggregate is
used twice in the same select.
Any hints or advice??
If someone has this done already let me know.
I may want do a "median" aggregate function too as I'll need that
later. This would require private storage and a sort.
Could you cc me at both addresses below as I move around between
chris(at)topdog(dot)logicon(dot)com Voice: 626-351-0089 X127
pgsql-hackers by date
|Next:||From: Stupor Genius||Date: 1998-06-05 01:35:56|
|Subject: RE: [HACKERS] Standard Deviation function.|
|Previous:||From: USA Publishing Co.||Date: 1998-06-05 00:43:37|
|Subject: Wanted Home Product Assemblers|