pgpool: Feature: remove frontend/backend protocol v2 support.

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: pgpool-committers(at)lists(dot)postgresql(dot)org
Subject: pgpool: Feature: remove frontend/backend protocol v2 support.
Date: 2026-11-06 10:59:56
Message-ID: E1xPHfo-0000000GDlP-41ie@gothos.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-committers

Feature: remove frontend/backend protocol v2 support.

PostgreSQL removed v2 protocol support in version 14, which was
released in 2021. The last version supporting protocol version 2 was
13, which was EOLed in November 2025. So supported PostgreSQL versions
at this point do not accept the protocol version 2 anymore (more
precisely, they response with "unsupported protocol version" error
when the protocol is requested).

This commit removes frontend/backend protocol v2 support from
Pgpool-II 4.8 and later. Previous versions still support v2 protocol.

In the code level, followings are done in this commit:

- Reject v2 protocol startup packet. If v2 frontend connects, raise a
FATAL error.

- Remove all v2 protocol branches except some codes in elog.c throwing
v2 error messages. Also fix some existing bugs with it.

- Remove the protocol major number argument from many functions.

- Remove src/protocol/pool_proto2.c, which handled v2 protocol messages.

- Remove MAJOR() macro.

- Remove pool_get_major_version() and pool_get_minor_version() family
functions. Also Remove member "major" and "minor" in
pool_session_context.h, that were used by these functions.

- Remove pool_read_string() in pool_stream.c, which was only used by
v2 protocol path. Also remove "sbuf" and "sbufsz" in POOL_CONNECTION
which was used by pool_read_string().

Author: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Reviewed-by: Nadav Shatz <nadav(at)tailorbrands(dot)com>
Discussion: https://www.postgresql.org/message-id/20260625.151428.1666276852188903568.ishii%40postgresql.org
Backpatch-through: master only

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=6c189588c34ea55d69356e9fa6c4e8fa120b334d

Modified Files
--------------
src/Makefile.am | 1 -
src/auth/pool_auth.c | 344 +++---
src/auth/pool_hba.c | 54 +-
src/context/pool_query_context.c | 12 +-
src/context/pool_session_context.c | 52 +-
src/include/context/pool_session_context.h | 8 -
src/include/pool.h | 19 -
src/include/protocol/pool_process_query.h | 18 +-
src/include/protocol/pool_proto_modules.h | 66 +-
src/include/utils/pool_stream.h | 3 +-
src/protocol/CommandComplete.c | 4 +-
src/protocol/child.c | 66 +-
src/protocol/pool_process_query.c | 1142 +++++++-------------
src/protocol/pool_proto2.c | 741 -------------
src/protocol/pool_proto_modules.c | 848 +++++----------
src/query_cache/pool_memqcache.c | 4 +-
src/rewrite/pool_lobj.c | 6 +-
src/rewrite/pool_timestamp.c | 4 +-
src/streaming_replication/pool_worker_child.c | 2 +-
.../tests/010.rewrite_timestamp/timestamp/main.c | 9 +-
src/tools/pgindent/typedefs.list | 1 -
src/utils/error/elog.c | 23 +-
src/utils/pool_process_reporting.c | 373 ++-----
src/utils/pool_relcache.c | 2 +-
src/utils/pool_stream.c | 257 +----
25 files changed, 1019 insertions(+), 3040 deletions(-)

Browse pgpool-committers by date

  From Date Subject
Next Message Tatsuo Ishii 2026-11-09 01:47:05 pgpool: Fix to use snprintf() instead of strlcpy() in pgproto.
Previous Message Taiki Koshino 2026-11-06 06:34:00 pgpool: Feature: Import PostgreSQL 19 parser.