Re: libpq: Fix lots of discrepancies in PQtrace
Jelte Fennema-Nio <postgres@jeltef.nl>
From: Jelte Fennema-Nio <postgres@jeltef.nl>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Michael Paquier <michael@paquier.xyz>,
Nathan Bossart <nathandbossart@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-08-14T18:18:36Z
Lists: 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
Commits
-
libpq: Trace all messages received from the server
- b8b3f861fbd7 18.0 landed
-
libpq: Trace responses to SSLRequest and GSSENCRequest
- a5c6b8f22c20 18.0 landed
-
libpq: Trace frontend authentication challenges
- ea92f3a0a5ad 18.0 landed
-
libpq: Trace StartupMessage/SSLRequest/GSSENCRequest correctly
- 7adec2d5fc29 18.0 landed
-
libpq: Add suppress argument to pqTraceOutputNchar
- 4eb179e5bf7a 18.0 landed
-
Use PqMsg_* macros in fe-auth.c.
- 32f07991b728 17.0 landed