Re: pg_amcheck: Fix block number parsing on command line

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_amcheck: Fix block number parsing on command line
Date: 2021-07-23 05:11:49
Message-ID: YPpPlWeBJowXO9ps@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 22, 2021 at 04:56:56PM +0200, Peter Eisentraut wrote:
> It seems to me that when using the pg_amcheck --startblock and --endblock
> options on platforms where sizeof(long) == 4, you cannot specify higher
> block numbers (unless you do tricks with negative numbers). The attached
> patch should fix this by using strtoul() instead of strtol(). I also
> tightened up the number scanning a bit in other ways, similar to the code in
> other frontend utilities. I know some people have been working on
> tightening all this up. Please check that it's up to speed.

Yeah, some work is happening to tighten all that. Saying that, the
first round of review I did for the option parsing is not involving
option types other than int32, so the block options of pg_amcheck are
not changing for now, and what you are suggesting here is fine for the
moment for 14~. Still, note that I am planning to change that on HEAD
with an option parsing API for int64 that could be used for block
numbers, eliminating for example the 4 translatable strings for the
code being changed here.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message tanghy.fnst@fujitsu.com 2021-07-23 05:34:26 RE: [PATCH] support tab-completion for single quote input with equal sign
Previous Message Greg Nancarrow 2021-07-23 05:00:07 Re: Parallel INSERT SELECT take 2