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