From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use StringInfo to build the result in oidvectortypes()
Date: Thu, 15 Oct 2026 13:52:10 +0000
Message-ID: <E1xHLsQ-00000001k1J-3WUD@gemulon.postgresql.org> (raw)
Use StringInfo to build the result in oidvectortypes()
Replace manual buffer management with StringInfo to avoid repeatedly
scanning the accumulated output when appending type names. This
removes quadratic scanning for large input vectors and simplifies the
code.
Also check for interrupts in the loop and free temporary type names
after appending them to the result.
Author: Chao Li <lic@highgo.com>
Reviewed-by: Japin Li <japinli@hotmail.com>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://www.postgresql.org/message-id/70611808-81DA-4B99-A3DB-7371F7EA4702@gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a999971331301a4a2f945220733b11af90cc2962
Modified Files
--------------
src/backend/utils/adt/format_type.c | 36 +++++++++++++-----------------------
1 file changed, 13 insertions(+), 23 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: heikki.linnakangas@iki.fi
Subject: Re: pgsql: Use StringInfo to build the result in oidvectortypes()
In-Reply-To: <E1xHLsQ-00000001k1J-3WUD@gemulon.postgresql.org>
References: <E1xHLsQ-00000001k1J-3WUD@gemulon.postgresql.org>
* 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