Re: libpq stricter integer parsing

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Michael Paquier <michael@paquier.xyz>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2018-09-11T17:03:41Z
Lists: pgsql-hackers

Attachments

>> +   <para>...</para>
>
> I would leave this out.  We don't need to document every single
> refinement of parsing rules.  This might better belong in the release notes.

Why not, I'd be fine with that. The fact that the libpq parser was quite 
fuzzy was not documented, the behavior was really a side effect of the 
implementation which never suggested that it would work.

>> +	appendPQExpBuffer(&conn->errorMessage,
>> +					  libpq_gettext("invalid value for keyword \"%s\"\n"),
>> +					  context);
>
> Add the actual invalid value to the error message.

Indeed.

Attached Michael's simplified version updated with your remarks.

-- 
Fabien.

Commits

  1. Parse more strictly integer parameters from connection strings in libpq