requesting features in PostgreSQL - Mailing list pgsql-general

From Andrew Gould
Subject requesting features in PostgreSQL
Date
Msg-id 20020426125430.62788.qmail@web13408.mail.yahoo.com
Whole thread Raw
Responses Re: requesting features in PostgreSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I would like to request a new aggregate function for
PostgreSQL.

I need an aggregate function that calculates geometric
mean, and can be used in SQL statements the same as
any other aggregate function such as count(), sum()
and avg().  Rather than have a custom function, I'd
like to see it added as a standard PostgreSQL feature.

Is there a specific PostgreSQL developer that I should
contact?  Or is an open request on this list
sufficient for consideration?

The geometric mean function, I'll call it gmean(), is
similar to avg(), except that instead of adding the
individual values, you would multiply them; and
instead of dividing the sum by the sample size, you
would raise the resulting product by a power of (1 /
sample size).

Therefore, the gmean() of the values 1, 2, 3 and 9
would equal:
  = (1 * 2 * 3 * 9) ^ (1 / 4)
  = 54 ^ 0.25
  = 2.710806  # rounded to 6 decimal places

This function differs from arithmetic mean (average)
in that it lessens the affect of outliers without
discounting them altogether.

Thanks,

Andrew Gould

__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

pgsql-general by date:

Previous
From: Uros Gruber
Date:
Subject: Re: Auth problem in pg_hdba.conf
Next
From: postgres@vrane.com
Date:
Subject: intel vs amd benchmark for pg server