Re: libpq: Fix lots of discrepancies in PQtrace

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: libpq: Fix lots of discrepancies in PQtrace
Date: 2024-08-14 18:18:36
Message-ID: CAGECzQRLOQh9Wkz5MQsULCy4jfETT=HjD1ZuEDYd1TNqy75S2A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 14 Aug 2024 at 19:37, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2024-08-14 19:00:52 Re: Remaining dependency on setlocale()
Previous Message Nathan Bossart 2024-08-14 18:16:06 Re: Remove dependence on integer wrapping