pgcat icon indicating copy to clipboard operation
pgcat copied to clipboard

Add support for negotiating the protocol version with the client

Open JelteF opened this issue 1 year ago • 0 comments
trafficstars

Is your feature request related to a problem? Please describe.

The postgres protocol spec includes a NegotiateProtocolVersion message type, which allows the server to tell the client that it only supports a.

There are quite some threads ongoing at postgres to bump the minor protocol version. If any of those get merged, then those clients would not be able to connect to an old pgcat version, because they would ask for protocol version 3.1

Describe the solution you'd like Send the NegotiateProtocolVersion when the client requests a higher minor version.

Additional context

For reference this is the Postgres commit introducing NegotiateProtocolVersion: https://github.com/postgres/postgres/commit/ae65f6066dc3d19a55f4fdcd3b30003c5ad8dbed

Also a PR for PgBouncer that adds the same functionality: https://github.com/pgbouncer/pgbouncer/pull/1007

You can try this patchset to have libpq ask for a protocol version 3.1: https://www.postgresql.org/message-id/flat/CAGECzQScQ3N-Ykv2j4NDyDtrPPc3FpRoa%3DLZ-2Uj2ocA4zr%3D4Q%40mail.gmail.com#cd9e8407820d492e8f677ee6a67c21ce

JelteF avatar Mar 09 '24 12:03 JelteF