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

From: Neil Chen <carpenter(dot)nail(dot)cz(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:49:51
Message-ID: CAA3qoJkE+dgGWbWiP8dCjQnWQ0NB=MdFuto60GcgeXP0uU=0AA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 20, 2025 at 9:27 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message torikoshia 2025-11-20 01:52:25 Re: RFC: Logging plan of the running query
Previous Message Peter Smith 2025-11-20 01:41:50 Re: CREATE/ALTER PUBLICATION improvements for syntax synopsis