Re: oauth integer overflow
Jacob Champion <jacob.champion@enterprisedb.com>
From: Jacob Champion <jacob.champion@enterprisedb.com>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Andres Freund <andres@anarazel.de>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2026-04-23T18:31:34Z
Lists: pgsql-hackers
Attachments
- 0001-libpq-oauth-Avoid-overflow-for-very-large-intervals.patch (application/octet-stream) patch 0001
On Thu, Apr 23, 2026 at 11:17 AM Daniel Gustafsson <daniel@yesql.se> wrote: > > Cool. I have one written up and can share it for comparison, if you'd > > like, but it's fairly verbose and I wonder if there's a better way to > > do it. > > Well, if you're already done then please do share it, and we'll use that as a > starting point. Attached. The static_assert for the millisecond calculation is the only part I don't really like, but doing an overflow check on a calculation that can't overflow int64 is even more verbose/wasteful. --Jacob