Re: Use strtoi64() in pgbench, replacing its open-coded implementation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Chen <carpenter(dot)nail(dot)cz(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Use strtoi64() in pgbench, replacing its open-coded implementation
Date: 2025-11-20 01:27:09
Message-ID: 1775639.1763602029@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Chen <carpenter(dot)nail(dot)cz(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Karlsson 2025-11-20 01:29:16 Re: ON CONFLICT DO SELECT (take 3)
Previous Message Tom Lane 2025-11-20 01:23:01 Re: PRI?64 vs Visual Studio (2022)