Re: Refactor StringInfo usage in subscriptioncmds.c

From: Mats Kindahl <mats(dot)kindahl(at)gmail(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, David Rowley <dgrowleyml(at)gmail(dot)com>
Subject: Re: Refactor StringInfo usage in subscriptioncmds.c
Date: 2025-11-06 12:47:35
Message-ID: 222afb8b-40da-493a-8a61-1b9cbc72138a@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/6/25 13:40, Álvaro Herrera wrote:
> On 2025-Nov-06, Mats Kindahl wrote:
>
>> Attached is a proposal that instead of building error message and hints
>> dynamically, it will use ereport() directly and as a result does not have to
>> allocate the error message strings and error message hints dynamically and
>> these can be removed.
> LGTM, thanks.
>
> I agree with Amit that there doesn't seem to be a need to free
> pubnames.data. We're already leaking publist, for instance. This is
> okay since we only call these functions during DDL, which in general is
> not sensitive to leaks.

Seems reasonable. Here is an updated version that removes the pfree() calls.

Best wishes,
Mats Kindahl

Attachment Content-Type Size
0001-Refactor-StringInfo-usage-in-subscriptioncmds.c.v2.patch text/x-patch 5.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2025-11-06 12:59:00 Re: Calling PGReserveSemaphores() from CreateOrAttachShmemStructs
Previous Message Heikki Linnakangas 2025-11-06 12:46:33 Re: Calling PGReserveSemaphores() from CreateOrAttachShmemStructs