This probably belongs on General, but
On Fri, Feb 29, 2008 at 9:11 AM, Justin <justin(at)emproshunts(dot)com> wrote:
> Need help and direction creating new aggregate functions.
> We need to add more average functions for both scientific and finical
> RMS for electrical measurement purposes
> Mode for both electrical and finical
> Weighted Average finical purposes
> Generalized mean for electrical measurement purposes
> Geometric mean for electrical measurement purposes
> Harmonic mean for electrical measurement purposes
> what would be the best way to create these new functions??
Have you already read the documentation on creating aggregates? Have
you tried something and it didn't work, or are you interested in
design ideas? I would just knock together something in plpgsql. If
you have trouble, send the specific questions to the list.
"best" ? C is fastest, etc -- what kind of tradeoffs do you need to satisfy?
One thing worth thinking about is using arrays to carry state from one
function call to the next in an aggregate; this is how the function
used in the average aggregate keeps track of both the running total
and the number of rows. The Stdev uses a three item array similarly.
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
In response to
pgsql-hackers by date
|Next:||From: Alvaro Herrera||Date: 2008-02-29 19:42:27|
|Subject: Re: bug or not bug, xmlvalidate(xml, text) can read andshow one line from file|
|Previous:||From: Peter Eisentraut||Date: 2008-02-29 19:30:10|
|Subject: Re: bug or not bug, xmlvalidate(xml, text) can read and show one line from file|