Feature: implement NegotiateProtocolVersion message.
authorTatsuo Ishii <ishii@postgresql.org>
Wed, 9 Jul 2025 06:58:16 +0000 (15:58 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Wed, 9 Jul 2025 06:58:16 +0000 (15:58 +0900)
commit766e738118e15a564e205429564cbfe1915d684e
tree9f31def785c85b03aaf4fe27e5a198f452e2d4f8
parent864a1fe114a6af283804f1c3e231ed697a0a8573
Feature: implement NegotiateProtocolVersion message.

Implementing the message is necessary when frontend requests the
protocol version 3.2 (i.e. PostgreSQL 18+ or compatible clients),
while backend still only supports 3.0 (i.e. backend is PostgreSQL 17
or before).

This commit handles the message so that the message is forwarded from
backend to frontend when there's no connection cache exists.

If connection cache exists, pgpool sends the message, which has been
saved at the time when the connection cache was created, to frontend.

Note that the frontend/backend protocol 3.2 changes the BackendKeyData
message format, but it's not implemented in this commit yet. This
means that still pgpool cannot handle 3.2 protocol.

Discussion: https://www.postgresql.org/message-id/20250708.112133.1324153277751075866.ishii%40postgresql.org
src/auth/pool_auth.c
src/include/pool.h
src/protocol/child.c
src/protocol/pool_connection_pool.c