"mcelroy, tim" <tim.mcelroy@bostonstock.com> writes:
> ERROR: function round(double precision, integer) does not exist
Try coercing to numeric instead of float. Also, it'd be a good idea to
put that coercion outside the sum()'s instead of inside --- summing
bigints is probably noticeably faster than summing numerics.
regards, tom lane