Re: Use strtoi64() in pgbench, replacing its open-coded implementation - Mailing list pgsql-hackers

From Neil Chen
Subject Re: Use strtoi64() in pgbench, replacing its open-coded implementation
Date
Msg-id CAA3qoJkE+dgGWbWiP8dCjQnWQ0NB=MdFuto60GcgeXP0uU=0AA@mail.gmail.com
Whole thread Raw
In response to Re: Use strtoi64() in pgbench, replacing its open-coded implementation  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On Thu, Nov 20, 2025 at 9:27 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Heikki's draft commit message addresses that point:

    The old implementation accepted trailing whitespace, but that seemed
    unnecessary. Firstly, its sibling function for parsing decimals,
    strtodouble(), does not accept trailing whitespace. Secondly, none of
    the callers can pass a string with trailing whitespace to it.


My mistake – Heikki is absolutely right.
Looking at the two call sites of the function: one filters out trailing spaces within the 'is_an_int' function, and the other in exprscan.l won’t pass strings with trailing spaces either.
 
I didn't try to verify the latter assertion, but if it's true,
we don't need the extra complication.


make sense

pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: CREATE/ALTER PUBLICATION improvements for syntax synopsis
Next
From: torikoshia
Date:
Subject: Re: RFC: Logging plan of the running query