pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove useless range checks on INT8 sequences
Date: Tue, 13 Jul 2021 01:57:18 +0000
Message-ID: <E1m37fi-0007Dd-QR@gemulon.postgresql.org> (raw)

Remove useless range checks on INT8 sequences

There's no point in checking if an INT8 sequence has a seqmin and seqmax
value is outside the range of the minimum and maximum values for an int64
type.  These both use the same underlying types so an INT8 certainly
cannot be outside the minimum and maximum values supported by int64.

This code is fairly harmless and it seems likely that most compilers
would optimize it out anyway, never-the-less, let's remove it replacing
it with a small comment to mention why the check is not needed.

Author: Greg Nancarrow, with the comment revised by David Rowley
Discussion: https://postgr.es/m/CAJcOf-c9KBUZ8ow_6e%3DWSfbbEyTKfqV%3DVwoFuODQVYMySHtusw%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e0271d5f1e871dd61efc26bda8a0b556c7935901

Modified Files
--------------
src/backend/commands/sequence.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)



Message-ID: <E1m37fi-0007Dd-QR@gemulon.postgresql.org>
Permalink:  ../E1m37fi-0007Dd-QR@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1m37fi-0007Dd-QR@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: drowley@postgresql.org
  Subject: Re: pgsql: Remove useless range checks on INT8 sequences
  In-Reply-To: <E1m37fi-0007Dd-QR@gemulon.postgresql.org>
  References: <E1m37fi-0007Dd-QR@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox