[pgpool-hackers: 2749] Deal with NegotiateProtocolVersion message

Tatsuo Ishii ishii at sraoss.co.jp
Thu Mar 22 09:42:00 JST 2018


PostgreSQL 10.2, 9.6.7, 9.5.11, 9.4.16 and 9.3.21 added a new backend
message in PostgreSQL's Frontend/Backend protocol.

>From the release note:
-----------------------------------------------------------------------
 Provide for forward compatibility with future minor protocol versions
 (Robert Haas, Badrul Chowdhury)

Up to now, PostgreSQL servers simply rejected requests to use protocol
versions newer than 3.0, so that there was no functional difference
between the major and minor parts of the protocol version
number. Allow clients to request versions 3.x without failing, sending
back a message showing that the server only understands 3.0. This
makes no difference at the moment, but back-patching this change
should allow speedier introduction of future minor protocol upgrades.
-----------------------------------------------------------------------

The new message is called "NegotiateProtocolVersion" and explained here:

https://www.postgresql.org/docs/10/static/protocol-flow.html#id-1.10.5.7.3

-----------------------------------------------------------------------
NegotiateProtocolVersion

    The server does not support the minor protocol version requested
    by the client, but does support an earlier version of the
    protocol; this message indicates the highest supported minor
    version. This message will also be sent if the client requested
    unsupported protocol options (i.e. beginning with _pq_.) in the
    startup packet. This message will be followed by an ErrorResponse
    or a message indicating the success or failure of authentication.
-----------------------------------------------------------------------

The message for is explained here:

https://www.postgresql.org/docs/10/static/protocol-message-formats.html

-----------------------------------------------------------------------
NegotiateProtocolVersion (B)

    Byte1('v')

        Identifies the message as a protocol version negotiation
        message.

    Int32

        Length of message contents in bytes, including self.

    Int32

        Newest minor protocol version supported by the server for the
        major protocol version requested by the client.

    Int32

        Number of protocol options not recognized by the server.

    Then, for protocol option not recognized by the server, there is
    the following:

    String

        The option name.
-----------------------------------------------------------------------

For now there's no client driver which supports this as far as I know
(even libpq does not support this at this moment). So I think
Pgpool-II does not need to dealt with this as soon as possible.

Comments?
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


More information about the pgpool-hackers mailing list