Fix extended-protocol DISCARD handling.

From: Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp>
To: "pgpool-hackers(at)lists(dot)postgresql(dot)org" <pgpool-hackers(at)lists(dot)postgresql(dot)org>
Subject: Fix extended-protocol DISCARD handling.
Date: 2026-10-14 00:57:36
Message-ID: OS9P286MB6486BE7D4F5F27CAF7265E16949D2@OS9P286MB6486.JPNP286.PROD.OUTLOOK.COM
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-hackers

Hi,

The attached patch fixes two issues with DISCARD commands in the
extended query protocol.

DISCARD ALL cleared the sent message list while CommandComplete()
was still using the current query context, causing a "no query context"
error. The patch defers clearing the list until the query context is
no longer needed.

DISCARD PLANS also cleared saved Query and Parse messages, although
PostgreSQL keeps prepared statements. The patch preserves these
messages so that subsequent Bind messages can reuse them.

This issue was originally reported here:
https://github.com/pgpool/pgpool2/issues/175

Best regards,

Taiki Koshino<koshino(at)sraoss(dot)co(dot)jp>
SRA OSS K.K.
TEL: 03-5979-2701 FAX: 03-5979-2702
URL: https://www.sraoss.co.jp/

Attachment Content-Type Size
v3-0001-Fix-extended-protocol-DISCARD-ALL-and-statement-r.patch application/octet-stream 2.8 KB

Responses

Browse pgpool-hackers by date

  From Date Subject
Next Message Koshino Taiki 2026-10-14 00:59:38 Fix SQLSTATE for Bind referencing a nonexistent prepared statement
Previous Message Tatsuo Ishii 2026-10-13 23:00:04 Re: Removing support for FE/BE protocol version 2