Re: Small memory fixes for pg_createsubcriber

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>, Euler Taveira <euler@eulerto.com>, "ranier.vf@gmail.com" <ranier.vf@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-02-13T04:50:29Z
Lists: pgsql-hackers
On Wed, Feb 12, 2025 at 07:08:31PM -0500, Tom Lane wrote:
> I spent a little time earlier today seeing what I could do with the
> use-dmalloc patch I posted earlier.  It turns out you can get through
> initdb after s/free/PQfreemem/ in just two places, and then the
> backend works fine.  But psql is a frickin' disaster --- there's
> free's of strings made with PQExpBuffer all over its backslash-command
> handling, and no easy way to clean it up.  Maybe other clients will
> be less of a mess, but I'm not betting on that.

Hmm.  Okay.  It sounds like it would be better to group everything
that has been pointed together towards what should be a more generic
solution than what I have posted.  So I am holding on touching
anything.
--
Michael

Commits

  1. pg_upgrade: Fix inconsistency in memory freeing

  2. pg_amcheck: Fix inconsistency in memory freeing

  3. Fix some inconsistencies with memory freeing in pg_createsubscriber

  4. Drop pre-existing subscriptions from the converted subscriber.