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.1603082137360.25393@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
List pgsql-hackers
Hello Robert.

Here is a v34 b & c.

> // comments are not allowed.  I'd just remove the two you have.

Back to the eighties!

> It make no sense to exit(1) and then return 0, so don't do that.  I
> might write this code as:
> This would get rid of the internal-error case here altogether in favor
> of testing it via an assertion.

I've put assertions instead of exit in some places.

> I think that coerceToInt() should not exit(1) when an overflow occurs;

I think that it should, because the only sane option for the user is to 
fix the script and relaunch the bench: counting errors has no added value 
for the user.

The attached version does some error handling instead, too bad.

> Now, if rval is out of range of an integer, that is going to overflow
> while trying to see whether it should divide by zero.

I could not find a place where there where such potential issue. If the 
value is zero, it cannot overflow when cast to int. If it is not zero but 
it overflows, then it is an overflow, so it should overflow. Maybe I 
misunderstood your point.

-- 
Fabien.

pgsql-hackers by date:

Previous
From: Artur Zakirov
Date:
Subject: Re: Proposal: Generic WAL logical messages
Next
From: Oleksii Kliukin
Date:
Subject: Re: empty array case in plperl_ref_from_pg_array not handled correctly