Re: libpq: Fix lots of discrepancies in PQtrace - Mailing list pgsql-hackers

From Jelte Fennema-Nio
Subject Re: libpq: Fix lots of discrepancies in PQtrace
Date
Msg-id CAGECzQRLOQh9Wkz5MQsULCy4jfETT=HjD1ZuEDYd1TNqy75S2A@mail.gmail.com
Whole thread Raw
In response to Re: libpq: Fix lots of discrepancies in PQtrace  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Responses Re: libpq: Fix lots of discrepancies in PQtrace
List pgsql-hackers
On Wed, 14 Aug 2024 at 19:37, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> - to 0005 I change your pqTraceOutputEncryptionRequestResponse()
>   function name to pqTraceOutputCharResponse and instead of attaching
>   the "Response" literal in the outpuer to the name given in the
>   function call, just pass the whole string as argument to the function.

Fine by me

> - to 0006 I change function name pqFinishParsingMessage() to
>   pqParseDone() and reworded the commentary; also moved it to fe-misc.c.
>   Looks good otherwise.

The following removed comments seems useful to keep (I realize I
already removed them in a previous version of the patch, but I don't
think I did that on purpose)

-       /* Drop the processed message and loop around for another */

-               /* consume the message and exit */


-       /* Completed this message, keep going */
-       /* trust the specified message length as what to skip */


> - 0008 to fix NegotiateProtocolVersion looks correct per [1], but I
>   don't know how to test it.  Suggestions?

Two options:
1. Manually change code to make sure SendNegotiateProtocolVersion is
called in src/backend/tcop/backend_startup.c
2. Apply my patches from this thread[2] and use
max_protocol_version=latest in the connection string while connecting
to an older postgres server.

[2]:
https://www.postgresql.org/message-id/flat/CAGECzQTyXDNtMXdq2L-Wp%3DOvOCPa07r6%2BU_MGb%3D%3Dh90MrfT%2BfQ%40mail.gmail.com#1b8cda3523555aafae89cc04293b8613



pgsql-hackers by date:

Previous
From: Joseph Koshakow
Date:
Subject: Re: Remove dependence on integer wrapping
Next
From: Jeff Davis
Date:
Subject: Re: Remaining dependency on setlocale()