Re: extend pgbench expressions with functions - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: extend pgbench expressions with functions
Date
Msg-id alpine.DEB.2.10.1601272249490.12620@sto
Whole thread Raw
In response to Re: extend pgbench expressions with functions  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: extend pgbench expressions with functions  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Hello Robert,

>>> And this one generates a core dump:
>>> \set cid debug(-9223372036854775808 / -1)
>>> Floating point exception: 8 (core dumped)
>
> That does not seem acceptable to me. I don't want pgbench to die a 
> horrible death if a floating point exception occurs any more than I want 
> the server to do the same.  I want the error to be properly caught and 
> reported.

Please note that this issue/bug/feature/whatever already exists just for 
these two values (1/2**128 probability), it is not related to this patch 
about functions.
  sh> pgbench --version  pgbench (PostgreSQL) 9.5.0
  sh> cat div.sql  \set i -9223372036854775807  \set i :i - 1  \set i :i / -1
  sh> pgbench -f div.sql  starting vacuum...end.  Floating point exception (core dumped)

I do not think that it is really worth fixing, but I will not prevent 
anyone to fix it.

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Patch: ResourceOwner optimization for tables with many partitions
Next
From: Fabien COELHO
Date:
Subject: Re: extend pgbench expressions with functions