pgsql: Remove useless range checks on INT8 sequences

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove useless range checks on INT8 sequences
Date: 2021-07-13 01:57:18
Message-ID: E1m37fi-0007Dd-QR@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-07-13 04:15:48 Re: pgsql: Add PSQL_WATCH_PAGER for psql's \watch command.
Previous Message David Rowley 2021-07-13 01:32:34 pgsql: Robustify tuplesort's free_sort_tuple function