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

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

Hi,

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.
I've attached a patch to remove those useless checks.
The MINVALUE/MAXVALUE values are anyway int64 range-checked prior to
this, as part of conversion to int64.

Regards,
Greg Nancarrow
Fujitsu Australia

Attachment Content-Type Size
v1-0001-Remove-useless-int64-range-checks-on-BIGINT-sequence.patch application/octet-stream 2.0 KB

Responses

Browse pgsql-hackers by date

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