pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ning Sun <classicning@gmail.com>
To: pgsql-hackers@postgresql.org
Subject: Add ParameterDescription message to libpq frontend long message types
Date: Wed, 1 Apr 2026 14:32:17 +0800
Message-ID: <dbfb4b65-0aa8-470a-8b87-b6496160b28a@gmail.com> (raw)

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.

Attachments:

0001-add-ParameterDescription-to-long-message-types.patch (text/x-patch, 829B) download From 6036564be819db0beb3efc1ad52c981922d52529 Mon Sep 17 00:00:00 2001 From: Ning Sun <sunning@greptime.com> 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

view thread (4+ messages)  latest in thread

Message-ID: <dbfb4b65-0aa8-470a-8b87-b6496160b28a@gmail.com>
Permalink:  ../dbfb4b65-0aa8-470a-8b87-b6496160b28a@gmail.com/
Also on:    postgresql.org/message-id/dbfb4b65-0aa8-470a-8b87-b6496160b28a@gmail.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: classicning@gmail.com
  Subject: Re: Add ParameterDescription message to libpq frontend long message types
  In-Reply-To: <dbfb4b65-0aa8-470a-8b87-b6496160b28a@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox