Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values
Дата
Msg-id 2690d581-6ab9-de84-968c-d6e5374e245d@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values  (Greg Nancarrow <gregn4422@gmail.com>)
Ответы Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values
Список 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 по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Add ZSON extension to /contrib/
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH v3 1/1] Fix detection of preadv/pwritev support for OSX.