Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Greg Nancarrow <gregn4422@gmail.com>, David Rowley <dgrowleyml@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-07-03T10:44:15Z
Lists: pgsql-hackers
On 21.06.21 13:32, Greg Nancarrow wrote: > On Mon, Jun 21, 2021 at 8:32 PM David Rowley <dgrowleyml@gmail.com> wrote: >> >> It might be worth putting in a comment to mention that the check is >> not needed. Just in case someone looks again one day and thinks the >> checks are missing. >> >> Probably best to put this in the July commitfest so it does not get missed. > > Updated the patch, and will add it to the Commitfest, thanks. I don't think this is a good change. It replaces one perfectly solid, harmless, and readable line of code with six lines of comment explaining why the code isn't necessary (times two). And the code is now less robust against changes elsewhere. To maintain this robustness, you'd have to add assertions that prove that what the comment is saying is actually true, thus adding even more code. I think we should leave it as is.
Commits
-
Remove useless range checks on INT8 sequences
- e0271d5f1e87 15.0 landed