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

From Álvaro Herrera
Subject Re: Use strtoi64() in pgbench, replacing its open-coded implementation
Date
Msg-id 202511211320.2cf7ygcyrkbs@alvherre.pgsql
Whole thread Raw
In response to Re: Use strtoi64() in pgbench, replacing its open-coded implementation  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
On 2025-Nov-21, Heikki Linnakangas wrote:

> I don't feel the urge to refactor this myself right now, but we probably
> could simplify this further. For example, I wonder if we should remove
> is_an_int() altogether and rely on strtoi64() to return failure if the input
> does't look like a integer.

I had the same thought -- is_an_int() is not doing anything useful and
it would be better to get rid of it.  If we do have an integer-looking
that doesn't fit in int64, then maybe treating it as a double is not
wrong.  (I suppose if we wanted to have numeric values beyond int64
range and not lose precision, we would have to add separate support for
that.)

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Update timezone to C99
Next
From: Boris Mironov
Date:
Subject: Re: Idea to enhance pgbench by more modes to generate data (multi-TXNs, UNNEST, COPY BINARY)