pgpool: Fix extended-protocol DISCARD ALL and statement reuse after DIS

From: Taiki Koshino <koshino(at)sraoss(dot)co(dot)jp>
To: pgpool-committers(at)lists(dot)postgresql(dot)org
Subject: pgpool: Fix extended-protocol DISCARD ALL and statement reuse after DIS
Date: 2026-10-21 02:15:24
Message-ID: E1xJLrQ-00000008g70-1CtA@gothos.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-committers

Fix extended-protocol DISCARD ALL and statement reuse after DISCARD PLANS.

DISCARD ALL cleared the sent message list before CommandComplete()
finished using the current query context, causing a "no query context"
error and closing the frontend connection. Defer cleanup until the
context is no longer needed.

DISCARD PLANS also removed saved Query and Parse messages, although
PostgreSQL preserves prepared statements. Keep these records so that
subsequent Bind messages can reuse the statements without another Parse.

Author: Taiki Koshino(koshino(at)sraoss(dot)co(dot)jp)
Discussion: https://github.com/pgpool/pgpool2/issues/175
Backpatch-through: v4.3

Branch
------
V4_6_STABLE

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

Modified Files
--------------
src/protocol/CommandComplete.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)

Browse pgpool-committers by date

  From Date Subject
Next Message Taiki Koshino 2026-10-21 02:16:15 pgpool: Fix extended-protocol DISCARD ALL and statement reuse after DIS
Previous Message Taiki Koshino 2026-10-21 02:14:27 pgpool: Fix extended-protocol DISCARD ALL and statement reuse after DIS