Re: Weird function behavior from Sept 11 snapshot - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Weird function behavior from Sept 11 snapshot
Date
Msg-id 7015.968766793@sss.pgh.pa.us
Whole thread Raw
In response to Weird function behavior from Sept 11 snapshot  (Mike Mascari <mascarm@mascari.com>)
List pgsql-hackers
Mike Mascari <mascarm@mascari.com> writes:
> Under the snapshot from yesterday:
> ---------------------------------

> template1=# create function crap(int4) returns int4 
> as 'select sum(key) from test' language 'sql';
> ERROR:  return type mismatch in function: declared to return
> int4, returns numeric

I changed sum() on integer types to return numeric as a way of
avoiding overflow.  Also avg() on integers now returns numeric
so that you can get some fractional precision.  If you think this
was a bad idea, there's still time to debate it ... but we've had
repeated complaints about both of those issues.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: Dibs for upcoming commit
Next
From: Thomas Lockhart
Date:
Subject: Re: Weird function behavior from Sept 11 snapshot