Re: what data type should be returned by sum(float4) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: what data type should be returned by sum(float4)
Date
Msg-id 31561.1410142831@sss.pgh.pa.us
Whole thread Raw
In response to what data type should be returned by sum(float4)  (Kouhei Kaigai <kaigai@ak.jp.nec.com>)
List pgsql-hackers
Kouhei Kaigai <kaigai@ak.jp.nec.com> writes:
> The documentation says that return type of sum(expression) is...
>   bigint for smallint or int arguments, numeric for bigint arguments,
>   double precision for floating-point arguments, otherwise the same
>   as the argument data type

> Does it expect sum(float4) returns float8, doesn't it?

Good catch!  [ digs in commit history... ]  It looks like the claim
that sum(float4) produces float8 was introduced in my commit
d06ebdb8d3425185d7e641d15e45908658a0177d of 2000-07-17; but it seems
to have been an outright error, because sum(float4) was a separate
aggregate long before that.  Possibly a copy-and-paste mistake from
some other aggregate?  I sure don't remember.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Kouhei Kaigai
Date:
Subject: what data type should be returned by sum(float4)
Next
From: Stephen Frost
Date:
Subject: Re: proposal (9.5) : psql unicode border line styles