On Thu, Apr 23, 2026 at 11:37 AM Andres Freund <[email protected]> wrote: > How about instead making sure that actx->authz.interval never gets big enough > to have any chance of overflowing during either the += 5 or the * 1000? It's > clearly ok to error out well before that...
It probably is, but I guess the approach depends on whether you prefer checking at the time of operation, or attempting to reason about it ahead of time in far-away code. With the latter, if additional math is added in the future, then either the new overflow hazard gets missed, or the ceiling gets lowered again, or the new math gets an overflow check when the others don't. I prefer the time-of-use pattern, personally. --Jacob
