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

From David Rowley
Subject Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values
Date
Msg-id CAApHDvrJFzOcCUh8o1FFwm_Aje9gLN_GjVfwohYZJSXFeov_8w@mail.gmail.com
Whole thread Raw
In response to 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  (Greg Nancarrow <gregn4422@gmail.com>)
List pgsql-hackers
On Mon, 21 Jun 2021 at 22:10, Greg Nancarrow <gregn4422@gmail.com> wrote:
> Sequence MINVALUE/MAXVALUE values are read into "int64" variables and
> then range-checked according to the sequence data-type.
> However, for a BIGINT sequence, checking whether these are <
> PG_INT64_MIN or > PG_INT64_MAX always evaluates to false, as an int64
> can't hold such values.

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.

David



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: seawasp failing, maybe in glibc allocator
Next
From: Japin Li
Date:
Subject: Re: Fix for segfault in logical replication on master