Re: Use strtoi64() in pgbench, replacing its open-coded implementation
Neil Chen <carpenter.nail.cz@gmail.com>
From: Neil Chen <carpenter.nail.cz@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2025-11-20T01:49:51Z
Lists: 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
Commits
-
Use strtoi64() in pgbench, replacing its open-coded implementation
- 2aabaa52dffd 19 (unreleased) landed