Hi,
I'm maintaining a Rust library pgwire to implement postgres wire
protocol in rust. While doing a corner case test, I noticed the
inconsistency for ParameterDescription between backend and frontend.
The backend allows up to 65535 parameters in a prepared statement. But
when running Describe on the statement, there is a size limit of 30000
bytes for ParameterDescription on the frontend. This means we can only
describe statements with at most ~7500 parameters. For statements exceed
the limit, it ends up with error about the message size.
This patch simply adds ParameterDescription to VALID_LONG_MESSAGE_TYPE
whitelist to remove the cap.
From 6036564be819db0beb3efc1ad52c981922d52529 Mon Sep 17 00:00:00 2001
From: Ning Sun <[email protected]>
Date: Wed, 1 Apr 2026 11:53:38 +0800
Subject: [PATCH] add ParameterDescription to long message types
---
src/interfaces/libpq/fe-protocol3.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/interfaces/libpq/fe-protocol3.c b/src/interfaces/libpq/fe-protocol3.c
index 8c1fda5caf0..7fd49cb151e 100644
--- a/src/interfaces/libpq/fe-protocol3.c
+++ b/src/interfaces/libpq/fe-protocol3.c
@@ -42,7 +42,8 @@
(id) == PqMsg_FunctionCallResponse || \
(id) == PqMsg_NoticeResponse || \
(id) == PqMsg_NotificationResponse || \
- (id) == PqMsg_RowDescription)
+ (id) == PqMsg_RowDescription || \
+ (id) == PqMsg_ParameterDescription)
static void handleFatalError(PGconn *conn);
--
2.53.0