Re: Fixing memory leaks in postgres_fdw

Etsuro Fujita <etsuro.fujita@gmail.com>

From: Etsuro Fujita <etsuro.fujita@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Matheus Alcantara <matheusssilv97@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-07-26T11:36:10Z
Lists: pgsql-hackers
On Sat, Jul 26, 2025 at 5:49 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Pushed the larger patchset now.  I had to do a little more work
> to get it to play with 112faf137, but it wasn't hard.

Thanks for working on this!

Best regards,
Etsuro Fujita



Commits

  1. Silence leakage complaint about postgres_fdw's InitPgFdwOptions.

  2. Run pgindent on the changes of the previous patch.

  3. Reap the benefits of not having to avoid leaking PGresults.

  4. Create infrastructure to reliably prevent leakage of PGresults.

  5. Fix memory leakage in postgres_fdw's DirectModify code path.

  6. Avoid resource leaks when a dblink connection fails.