postgresml/pgcat

Add support for negotiating the protocol version with the client

Opened this issue · 0 comments

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: postgres/postgres@ae65f60

Also a PR for PgBouncer that adds the same functionality: pgbouncer/pgbouncer#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