Sergey's recent patch for the SQL2003 binary aggregates implements each
of them three times: in float4, float8, and numeric arithmetic. This
seems like vast overkill. The float4 versions certainly ought to go,
as they won't perform noticeably better than float8 and will likely be
subject to terrible roundoff-error problems. I'm also dubious about the
numeric versions. The spec says
b) Let DTDVE be the declared type of DVE and let DTIVE be the
declared type of IVE.
i) The declared type of REGR_COUNT is an implementation-defined
exact numeric type with scale of 0 (zero).
ii) Otherwise, the declared type of the result is an
implementation-defined approximate numeric type. If DTDVE is an
approximate numeric type, then the precision of the result is
not less than the precision of DTDVE. If DTIVE is an approximate
numeric type, then the precision of the result is not less than
the precision of DTIVE.
so as far as I can see we are *only* required to provide a float8
There is room to argue that the numeric-arithmetic version would be
worth having on the grounds of greater precision or range, but it's a
big chunk of code and the public demand for the functionality has not
exactly been overwhelming.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster