[postgis-users] User Defined Aggregates in Postgresql

David Bitner osgis.lists at gmail.com
Tue Nov 8 12:50:52 PST 2005


This is off-topic as far as Postgis, but I was hoping that someone could
help me before I went and signed on to yet another list.

I frequently need to find averages of numbers that are in decibels. Since
this is a logarithmic number, the appropriate way to do this is:
select 10*(log(avg(10^([decibel field])/10))

Writing this day in day out gets pretty old. I would like to create an
aggregate function decibel_average([decibel field]) but am finding the
documentation a bit confusing.

If any one has any pointers I would really appreciate the help (also, please
feel free to reply off list).

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20051108/9ec0de57/attachment.html>


More information about the postgis-users mailing list