On Thu, 15 Oct 2026 at 23:20, Japin Li <[email protected]> wrote:
> I believe the current patch is the smallest correct fix.  Introducing 
> StringInfo
> would be unnecessary over-engineering.

I'm assuming this is master only, so why does it need to be a minimal
fix? StringInfo is just the way we normally do incremental building of
strings. It's an API that most people who work on our code understand.
Manually calling repalloc() is tedious and more likely to have bugs.

Using StringInfo will also cut down on the number of reallocs due to
the size doubling. It'll also allow the
PG_RETURN_TEXT_P(cstring_to_text(result)); to be updated to use
cstring_to_text_with_len using the StringInfo's len field.

David


Reply via email to