Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values
Date
Msg-id 2690d581-6ab9-de84-968c-d6e5374e245d@enterprisedb.com
Whole thread Raw
In response to Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values  (Greg Nancarrow <gregn4422@gmail.com>)
Responses Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values  (David Rowley <dgrowleyml@gmail.com>)
List 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.



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Add ZSON extension to /contrib/
Next
From: Peter Eisentraut
Date:
Subject: Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.