pg_dump: Remove trivial usage of PQExpBuffer
Corey Huinker <corey.huinker@gmail.com>
From: Corey Huinker <corey.huinker@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2025-12-16T22:03:13Z
Lists: pgsql-hackers
Attachments
- v1-0001-Remove-PQExpBuffer-usage-in-trivial-cases.patch (text/x-patch)
I've been looking at ways to reorganize and/or clean up pg_dump.c. One thing I have noticed is the usage of PQExpBuffer in situations where the query has no optional parts and no string interpolation. Attached is a patch to replace those usages with the string literal itself. There are still a few cases where a buffer is used for a trivial query and then reset and reused for a more complicated query generation. In those cases, I did not make the change so as to keep this patch simple.