Re: libpq parameter parsing problem

Jobin Augustine <[email protected]> Tue, 14 Jan 2020 12:01:43 +0530
Newsgroups gmane.comp.db.postgresql.bugs
Message-ID <CANaTPsr=_2+Ajb-ENdT9QZyk3fjRSrgM+iuZO7vtxe0FU36NGQ@mail.gmail.com>
--0000000000008ac2b3059c13bf04
Content-Type: multipart/alternative; boundary="0000000000008ac2b0059c13bf02"

--0000000000008ac2b0059c13bf02
Content-Type: text/plain; charset="UTF-8"

Hi Michael,

On Tue, Jan 14, 2020 at 11:33 AM Michael Paquier <[email protected]>
wrote:

> On Mon, Jan 13, 2020 at 08:07:06PM +0530, Jobin Augustine wrote:
> > Sorry for the late reply. Attaching a patch.
>
> >     <para>
> > -    Percent-encoding may be used to include symbols with special
> meaning in any
> > -    of the <acronym>URI</acronym> parts, e.g. replace
> <literal>=</literal> with
> > -    <literal>%3D</literal>.
> > -
> > +    Connection <acronym>URI</acronym> need to be encoded with
> > +    <ulink url="https://en.wikipedia.org/wiki/Percent-encoding">Percent-encoding</ulink>
>
> > +    if it includes symbols with special meaning in any of its parts.
> > +    For example:
> > +<programlisting>
> > +postgresql://postgres@localhost
> :5432/postgres?options=-c%20synchronous_commit%3Doff%20-c%20geqo%3Doff
> > +</programlisting>
> > +    where all <literal>=</literal> are replaced with
> <literal>%3D</literal> and
> > +    space character with <literal>%20</literal>
> >     </para>
>
> The reference to wikipedia is nice to have.  A small nit from me is
> that I would group the last sentence with the "For example", to give:
> "Here is an example where all = are replaced.."
>
Yes, agree, readability is better with that modification.
Attaching a modified patch.

> The first sentence sounds good to me.
> --
> Michael
>
 Jobin.

--0000000000008ac2b0059c13bf02
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi=C2=A0Michael,</div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Tue, Jan 14, 2020 at 11:33 AM Mich=
ael Paquier &lt;<a href=3D"mailto:[email protected]">[email protected]<=
/a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0=
px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">O=
n Mon, Jan 13, 2020 at 08:07:06PM +0530, Jobin Augustine wrote:<br>
&gt; Sorry for the late reply. Attaching a patch.<br>
<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;para&gt;<br>
&gt; -=C2=A0 =C2=A0 Percent-encoding may be used to include symbols with sp=
ecial meaning in any<br>
&gt; -=C2=A0 =C2=A0 of the &lt;acronym&gt;URI&lt;/acronym&gt; parts, e.g. r=
eplace &lt;literal&gt;=3D&lt;/literal&gt; with<br>
&gt; -=C2=A0 =C2=A0 &lt;literal&gt;%3D&lt;/literal&gt;.<br>
&gt; -<br>
&gt; +=C2=A0 =C2=A0 Connection &lt;acronym&gt;URI&lt;/acronym&gt; need to b=
e encoded with <br>
&gt; +=C2=A0 =C2=A0 &lt;ulink url=3D&quot;<a href=3D"https://en.wikipedia.o=
rg/wiki/Percent-encoding" rel=3D"noreferrer" target=3D"_blank">https://en.w=
ikipedia.org/wiki/Percent-encoding</a>&quot;&gt;Percent-encoding&lt;/ulink&=
gt; <br>
&gt; +=C2=A0 =C2=A0 if it includes symbols with special meaning in any of i=
ts parts. <br>
&gt; +=C2=A0 =C2=A0 For example:<br>
&gt; +&lt;programlisting&gt;<br>
&gt; +postgresql://postgres@localhost:5432/postgres?options=3D-c%20synchron=
ous_commit%3Doff%20-c%20geqo%3Doff<br>
&gt; +&lt;/programlisting&gt;<br>
&gt; +=C2=A0 =C2=A0 where all &lt;literal&gt;=3D&lt;/literal&gt; are replac=
ed with &lt;literal&gt;%3D&lt;/literal&gt; and <br>
&gt; +=C2=A0 =C2=A0 space character with &lt;literal&gt;%20&lt;/literal&gt;=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;/para&gt;<br>
<br>
The reference to wikipedia is nice to have.=C2=A0 A small nit from me is<br=
>
that I would group the last sentence with the &quot;For example&quot;, to g=
ive:<br>
&quot;Here is an example where all =3D are replaced..&quot;<br></blockquote=
><div>Yes, agree, readability is better with that modification.</div><div>A=
ttaching a modified patch.</div><blockquote class=3D"gmail_quote" style=3D"=
margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef=
t:1ex">
The first sentence sounds good to me.<br>
--<br>
Michael<br></blockquote><div>=C2=A0Jobin.</div></div></div>

--0000000000008ac2b0059c13bf02--
--0000000000008ac2b3059c13bf04
Content-Type: text/x-patch; charset="US-ASCII"; name="libpqURIconnection_v2.diff"
Content-Disposition: attachment; filename="libpqURIconnection_v2.diff"
Content-Transfer-Encoding: base64
Content-ID: <f_k5dhvtq90>
X-Attachment-Id: f_k5dhvtq90

ZGlmZiAtLWdpdCBhL2RvYy9zcmMvc2dtbC9saWJwcS5zZ21sIGIvZG9jL3NyYy9zZ21sL2xpYnBx
LnNnbWwKaW5kZXggNjRjZmY0OWM0ZC4uZjcwNTlhZThjNCAxMDA2NDQKLS0tIGEvZG9jL3NyYy9z
Z21sL2xpYnBxLnNnbWwKKysrIGIvZG9jL3NyYy9zZ21sL2xpYnBxLnNnbWwKQEAgLTkyNSwxMCAr
OTI1LDE0IEBAIHBvc3RncmVzcWw6Ly8vbXlkYj9ob3N0PWxvY2FsaG9zdCZhbXA7cG9ydD01NDMz
CiAgICA8L3BhcmE+CiAKICAgIDxwYXJhPgotICAgIFBlcmNlbnQtZW5jb2RpbmcgbWF5IGJlIHVz
ZWQgdG8gaW5jbHVkZSBzeW1ib2xzIHdpdGggc3BlY2lhbCBtZWFuaW5nIGluIGFueQotICAgIG9m
IHRoZSA8YWNyb255bT5VUkk8L2Fjcm9ueW0+IHBhcnRzLCBlLmcuIHJlcGxhY2UgPGxpdGVyYWw+
PTwvbGl0ZXJhbD4gd2l0aAotICAgIDxsaXRlcmFsPiUzRDwvbGl0ZXJhbD4uCi0KKyAgICBDb25u
ZWN0aW9uIDxhY3JvbnltPlVSSTwvYWNyb255bT4gbmVlZCB0byBiZSBlbmNvZG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