Re: SUM(int2)/SUM(int4) do not detect overflow of the int8 accumulator - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SUM(int2)/SUM(int4) do not detect overflow of the int8 accumulator
Date
Msg-id 1412049.1788396306@sss.pgh.pa.us
Whole thread
Responses Re: Support EXCEPT for TABLES IN SCHEMA publications
List pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Wed, Sep 02, 2026 at 07:56:32PM -0400, Andres Freund wrote:
>> FWIW, I think we should seriously consider making [almost] all the transition
>> states internal.  Having to support calling these functions in non-aggregate
>> contexts adds complexity without any actual gain.  We shouldn't need to check
>> whether we are in an AggContext, whether the argument is toasted, whether
>> there are NULL elements in the array, compute offsets into the array, etc.

> +1.

Seems reasonable.  We could still have the actual representation be
int8[] or whatever if it saves code to do so, but we could declare
it internal at SQL level to remove these edge cases.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: PGQ catalog representation and pg_dump support
Next
From: Michael Paquier
Date:
Subject: Re: Remove fcinfo from statistics update internal functions