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

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Greg Nancarrow <gregn4422(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Remove useless int64 range checks on BIGINT sequence MINVALUE/MAXVALUE values
Date: 2021-06-21 10:32:10
Message-ID: CAApHDvrJFzOcCUh8o1FFwm_Aje9gLN_GjVfwohYZJSXFeov_8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 21 Jun 2021 at 22:10, Greg Nancarrow <gregn4422(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2021-06-21 10:39:10 Re: Fix for segfault in logical replication on master
Previous Message Andres Freund 2021-06-21 10:23:25 Re: seawasp failing, maybe in glibc allocator