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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, "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-03 15:57:16
Message-ID: 322798.1727971036@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I poked into the ecpg end of this and found that the extra space
is coming from one production in ecpg.trailer that's carelessly
using cat_str (which inserts spaces) instead of makeN_str
(which doesn't). So it's pretty trivial to fix, as attached.

I do not think we could rip out ECPGconnect's logic to remove the
spaces at runtime, because that would break existing ecpg
applications until they're recompiled. It might be worth adding
a comment there about why it's being done, though.

I don't have a strong opinion one way or the other about whether
we should make libpq permissive about extra spaces (as per
Michael's patch). I guess you could argue that all of these
fixes are consistent with the principle of "be conservative
with what you send and liberal with what you accept". But at
most I'd fix these remaining things in HEAD.

regards, tom lane

Attachment Content-Type Size
ecpg-avoid-extra-spaces-in-url-options.patch text/x-diff 2.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2024-10-03 17:12:47 Re: Enhance file_fdw to report processed and skipped tuples in COPY progress
Previous Message Jacob Champion 2024-10-03 15:54:49 Re: Retire support for OpenSSL 1.1.1 due to raised API requirements