On 01/09/2026 09:35, Chao Li wrote:
> If newval is negative, the minus operation may also overflow.
I don't think that's the case. An inverted function removes values that were
already included in the aggregate, which usually brings the total closer to zero
instead of pushing it toward the boundary. From what I see, this means there's
no risk of integer overflow.
--
regards, Andrei Lepikhov,
pgEdge