Re: [HACKERS] pow support for pgbench
Michael Paquier <michael.paquier@gmail.com>
From: Michael Paquier <michael.paquier@gmail.com>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Robert Haas <robertmhaas@gmail.com>, Raúl Marín Rodríguez <rmrodriguez@carto.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2017-12-27T01:03:22Z
Lists: pgsql-hackers
On Tue, Dec 26, 2017 at 11:26:58PM +0100, Fabien COELHO wrote: > > This version looks good to me, except that I wonder if we should try to > > switch to the floating-point version if the integer version would/does > > overflow. > > My 0.02€ is that it is under the user control who provides either ints or > doubles as arguments. So I do not think that we should bother, for what my > opinion is worth. > > If this is a new requirement, detecting the integer overflow is probably > possible with some testing, eg unexpected changes of sign, but that would > probably add two tests per round, and probably double the computation cost. And my 2c on the matter is that switching silently from one version to the other would be unwelcome. The user should be aware if a test is overflowing a number when specifying an integer. -- Michael
Commits
-
Add pow(), aka power(), function to pgbench.
- 7a727c180aa3 11.0 landed
-
pgbench: Support double constants and functions.
- 86c43f4e22c0 9.6.0 cited