Re: [BUG FIX]Connection fails with whitespace after keepalives parameter value - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: [BUG FIX]Connection fails with whitespace after keepalives parameter value
Date
Msg-id b89a6d01-0eaa-49cd-bb08-cf9036cc005f@oss.nttdata.com
Whole thread Raw
In response to Re: [BUG FIX]Connection fails with whitespace after keepalives parameter value  (Fujii Masao <masao.fujii@oss.nttdata.com>)
List pgsql-hackers

On 2024/10/06 18:35, Michael Paquier wrote:
> On Thu, Oct 03, 2024 at 08:12:28PM -0400, Tom Lane wrote:
>> OK, if there's no objections let's push both remaining patches
>> to HEAD only.
> 
> Done as of f22e84df1dea and 430ce189fc45.

Commit 430ce189fc45 unexpectedly caused psql to report the error
"error: trailing data found" when a connection URI contains
a whitespace, e.g., in a parameter value. For example,
the following command used to work but no longer does after this commit:

     $ psql -d "postgresql://localhost:5432/postgres?application_name=a b"

I'm not sure if this URI format is valid (according to RFC 3986), though.


+    for (const char *s = q; *s == ' '; s++)
+    {
+        q++;
+        continue;
+    }

Is the "continue" really necessary? Also could we simplify it like this?

     for (; *q == ' '; q++);

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION




pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: POC, WIP: OR-clause support for indexes
Next
From: "David G. Johnston"
Date:
Subject: Re: Psql meta-command conninfo+