Re: [BUG FIX]Connection fails with whitespace after keepalives parameter value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: "Yuto Sasaki (Fujitsu)" <sasaki(dot)yuto-00(at)fujitsu(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [BUG FIX]Connection fails with whitespace after keepalives parameter value
Date: 2024-10-01 16:29:15
Message-ID: 1858920.1727800155@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> writes:
> On 2024/10/01 14:11, Yuto Sasaki (Fujitsu) wrote:
>> Root cause: The method for parsing the keepalives parameter in the useKeepalives
>> function of the libpq library is not appropriate. Specifically, it doesn't
>> account for whitespace following the numeric value.

> Is a connection URL with whitespace, like "tcp:postgresql://localhost:5432/postgres?keepalives=1 & ...",
> considered valid? If not, the issue seems to be that ecpg adds unnecessary whitespace
> to the connection URL, especially after the "&" character.

I agree with Sasaki-san that useKeepalives seems rather bogus: almost
every other place in fe-connect.c uses pqParseIntParam rather than
calling strtol directly, so why not this one? We might have some
work to do in ecpg as well, though.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nitin Jadhav 2024-10-01 16:50:06 Re: Inconsistency in reporting checkpointer stats
Previous Message Fujii Masao 2024-10-01 16:10:22 Re: [BUG FIX]Connection fails with whitespace after keepalives parameter value