> Mean is just sum(col)/count(col)
You can also just use avg(col).
Either way, be careful because nulls may not be treated as you want for
such calculations.
The stats package R can access Postgres databases, and can be used for
robust statistical analyses of the data.
See:
http://sourceforge.net/projects/rdbi/
Cheers,
Brent Wood