Re: Avoid resource leak (src/bin/pg_dump/pg_dumpall.c)

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: yangyz <1197620467(at)qq(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid resource leak (src/bin/pg_dump/pg_dumpall.c)
Date: 2026-03-10 03:05:40
Message-ID: aa-KhBhDyUlrmW22@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 09, 2026 at 01:40:51PM +0100, Alvaro Herrera wrote:
> True, but at the same time it looks as if this routine is wastefully
> written -- I mean, why spend time with a stringinfo here at all? We
> could write this in much simpler form, as in the attached, which is even
> three lines shorter. In fact, before 763aaa06f034, this is exactly how
> this routine was written, and I don't see why it was changed this way.

Yeah, what you are doing here looks like the sensible thing to do.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Xuneng Zhou 2026-03-10 03:55:30 Re: Refactor recovery conflict signaling a little
Previous Message Michael Paquier 2026-03-10 03:01:25 Re: Remove redundant cast in gindesc.c