Skip site navigation (1) Skip section navigation (2)

requesting features in PostgreSQL

From: Andrew Gould <andrewgould(at)yahoo(dot)com>
To: Postgres Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: requesting features in PostgreSQL
Date: 2002-04-26 12:54:30
Message-ID: (view raw or whole thread)
Lists: pgsql-general
I would like to request a new aggregate function for

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.


Andrew Gould

Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more


pgsql-general by date

Next:From: postgresDate: 2002-04-26 13:36:56
Subject: intel vs amd benchmark for pg server
Previous:From: webmasterDate: 2002-04-26 12:50:53
Subject: delete column

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group