> On 25 Aug 2026, at 14:18, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org> wrote:
>
> Instead of open-coding this, how about about using pg_neg_s32_overflow?
>
> if (pg_neg_s32_overflow(n, &n))
> n = PG_INT32_MAX;
Yes, that's indeed a good idea.
--
Daniel Gustafsson