Re: proposal: psql: show current user in prompt - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: psql: show current user in prompt
Date
Msg-id CAFj8pRCKVzcq7E6f8bqsD0TYc6BFyh3PfsZdhxtEobFmpMxx3g@mail.gmail.com
Whole thread Raw
In response to Re: proposal: psql: show current user in prompt  (Jelte Fennema <postgres@jeltef.nl>)
Responses Re: proposal: psql: show current user in prompt
List pgsql-hackers


út 29. 8. 2023 v 14:11 odesílatel Jelte Fennema <postgres@jeltef.nl> napsal:
On Mon, 28 Aug 2023 at 15:00, Pavel Stehule <pavel.stehule@gmail.com> wrote:
+                       minServerMajor = 1600;
+                       serverMajor = PQserverVersion(pset.db) / 100;

Instead of using the server version, we should instead use the
protocol version negotiation that's provided by the
NegotiateProtocolVersion message type. We should bump the requested
protocol version from 3.0 to 3.1 and check that the server supports
3.1. Otherwise proxies or connection poolers might get this new
message type, without knowing what to do with them.

I checked this part and this part of the code, and it looks like current libpq doesn't allow optional requirements of higher protocol version number.

With the current state of NegotiateProtocolVersion handling I am not able to connect to any older servers, because there is no fallback implementation.

My personal feeling from this area is that the protocol design is done, but it is not implemented on libpq level. My feelings can be wrong. The protocol number is hardcoded in libpq, so I cannot change it from the client side.

But maybe I don't see some possibility?

Regards

Pavel


pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Testing autovacuum wraparound (including failsafe)
Next
From: Jelte Fennema
Date:
Subject: Re: proposal: psql: show current user in prompt