Re: libpq: Fix lots of discrepancies in PQtrace

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Jelte Fennema-Nio <postgres@jeltef.nl>
Cc: Michael Paquier <michael@paquier.xyz>, Nathan Bossart <nathandbossart@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-08-14T17:37:30Z
Lists: pgsql-hackers

Attachments

I gave another look to the remaining patches; here they are again.  I
propose some changes:

- 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.

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

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

I didn't look at 0007.

[1] https://www.postgresql.org/docs/16/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-NEGOTIATEPROTOCOLVERSION

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"No hay hombre que no aspire a la plenitud, es decir,
la suma de experiencias de que un hombre es capaz"

Commits

  1. libpq: Trace all messages received from the server

  2. libpq: Trace responses to SSLRequest and GSSENCRequest

  3. libpq: Trace frontend authentication challenges

  4. libpq: Trace StartupMessage/SSLRequest/GSSENCRequest correctly

  5. libpq: Add suppress argument to pqTraceOutputNchar

  6. Use PqMsg_* macros in fe-auth.c.