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

From Tom Lane
Subject Re: Use strtoi64() in pgbench, replacing its open-coded implementation
Date
Msg-id 1775639.1763602029@sss.pgh.pa.us
Whole thread Raw
In response to Re: Use strtoi64() in pgbench, replacing its open-coded implementation  (Neil Chen <carpenter.nail.cz@gmail.com>)
Responses Re: Use strtoi64() in pgbench, replacing its open-coded implementation
List pgsql-hackers
Neil Chen <carpenter.nail.cz@gmail.com> writes:
> +1 on this simplification – it definitely makes the code cleaner.
> One small note: the updated code doesn’t handle trailing spaces in the
> input string. Should we consider this a concern?

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.

I didn't try to verify the latter assertion, but if it's true,
we don't need the extra complication.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PRI?64 vs Visual Studio (2022)
Next
From: Andreas Karlsson
Date:
Subject: Re: ON CONFLICT DO SELECT (take 3)