Re: Possible 7.1RC1 bug - Mailing list pgsql-sql

From Tom Lane
Subject Re: Possible 7.1RC1 bug
Date
Msg-id 22126.986016790@sss.pgh.pa.us
Whole thread Raw
In response to Re: Possible 7.1RC1 bug  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-sql
"Josh Berkus" <josh@agliodbs.com> writes:
>> This is not a bug.  It's a deliberate change in behavior: sum() and
>> avg() on integer datatypes now return numeric, to avoid problems with
>> overflow.

> That could throw off some of my already-written views & functions.  Is
> there a setting that can change this back to the "regular" behavior of
> sum(integer) = integer?

Sorry, no.  You can coerce the result back to int4 if you care to risk
overflow: "select sum(int4field)::int4" or some such.
        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: possible row locking bug in 7.0.3 & 7.1
Next
From: Sharmad Naik
Date:
Subject: Library Management System