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

From Robert Haas
Subject Re: extend pgbench expressions with functions
Date
Msg-id CA+TgmoaiWPQrGnRCAWmQvd9rKr_j9vZ9BF6b3Cre76FYotdV3Q@mail.gmail.com
Whole thread Raw
In response to Re: extend pgbench expressions with functions  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: extend pgbench expressions with functions
List pgsql-hackers
On Wed, Mar 9, 2016 at 3:09 AM, Fabien COELHO <coelho@cri.ensmp.fr> wrote:
> I'm not sure what is "not acceptable" as it "totally breaks the error
> handling" in the above code.
>
> I assumed that you want to check that sscanf can read what sprintf generated
> when handling "\set". I'd guess that libc would be broken if it was the
> case. I've made pgbench check that it is not.

If the variable contains something that is not an integer, the
existing code will end up here:

fprintf(stderr, "invalid input syntax for integer: \"%s\"\n", str);

With your patch, you get different behavior depending on exactly how
the input is malformed.  I have a strong suspicion you're going to
tell me that this is another one of those cases where it's OK to make
the error handling worse than it is today, but I'm tired of arguing
that point.  I'm not going to commit it this way, and frankly, neither
is anyone else.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: multivariate statistics v14
Next
From: Gilles Darold
Date:
Subject: Patch to implement pg_current_logfile() function