Re: [PATCH] ltree, lquery, and ltxtquery binary protocol support

From: Nino Floris <mail(at)ninofloris(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] ltree, lquery, and ltxtquery binary protocol support
Date: 2020-04-01 21:52:59
Message-ID: CANmj9VzGK_BxrCfD08u2JsOpaKQhU=s-BfAf1uA_6CBxSYXOTQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Tom,

Thanks a lot for pushing this through.

In complete agreement on fixing mbstrlen, it would clearly have lead to cut
off string sends, or worse (does the binary protocol use null terminated
strings, or are they length prefixed?). Apologies anyways, it's been a
while so I don't know how it may have ended up there, thanks for catching
it.

Even though it was a bit bumpy, and vastly different from my usual github
contribution flow, I've had a good time contributing my first patch!

Best regards,
Nino Floris

On Apr 1, 2020 at 23:37, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

I wrote:
> Fortunately for the odds of getting this patch accepted, we just
> pushed an ALTER TYPE improvement that will solve your problem [1].
> Please replace ltree--1.2.sql with an upgrade script that uses
> that, and resubmit.

I decided it would be a shame for this to miss v13, seeing that
(a) it'd provide real-world use of that ALTER TYPE code, and
(b) we already bumped ltree's extension version for v13.

So I went ahead and rebased this, reviewed and pushed it. The
main non-cosmetic thing I changed, other than using ALTER TYPE,
was that you had the output functions looking like this:

pq_sendtext(&buf, res, pg_mbstrlen(res));

That's just wrong; it should be plain strlen(). Did you copy
that coding from someplace? I could not find any similar
occurrences in our code tree.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-04-01 21:58:31 Re: Proposal: Expose oldest xmin as SQL function for monitoring
Previous Message Tom Lane 2020-04-01 21:45:02 Re: Proposal: Expose oldest xmin as SQL function for monitoring