From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: libpq: Discard leading and trailing spaces for parameters and va
Date: Sun, 06 Oct 2024 09:23:31 +0000
Message-ID: <E1sxNUB-002Olo-Vy@gemulon.postgresql.org> (raw)
libpq: Discard leading and trailing spaces for parameters and values in URIs
Integer values applied a parsing rule through pqParseIntParam() that
made URIs like this one working, even if these include spaces around
values:
"postgresql://localhost:5432/postgres?keepalives=1 &keepalives_idle=1 "
This commit changes the parsing so as spaces before and after parameters
and values are discarded, offering more consistency with the parsing
that already applied to libpq for integer values in URIs.
Note that %20 can be used in a URI for a space character. ECPGconnect()
has been discarded leading and trailing spaces around parameters and
values that for a long time, as well. Like f22e84df1dea, this is done
as a HEAD-only change.
Reviewed-by: Yuto Sasaki
Discussion: https://postgr.es/m/Zv3oWOfcrHTph7JK@paquier.xyz
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/430ce189fc4521a1c197eee36b8ca6b37b29e86e
Modified Files
--------------
src/interfaces/libpq/fe-connect.c | 42 +++++++++++++++++++++++++++++++++------
src/interfaces/libpq/t/001_uri.pl | 18 +++++++++++++++++
2 files changed, 54 insertions(+), 6 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: libpq: Discard leading and trailing spaces for parameters and va
In-Reply-To: <E1sxNUB-002Olo-Vy@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox