Reap the benefits of not having to avoid leaking PGresults.
Tom Lane <tgl@sss.pgh.pa.us>
Reap the benefits of not having to avoid leaking PGresults. Remove a bunch of PG_TRY constructs, de-volatilize related variables, remove some PQclear calls in error paths. Aside from making the code simpler and shorter, this should provide some marginal performance gains. For ease of review, I did not re-indent code within the removed PG_TRY constructs. That'll be done in a separate patch. Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com> Discussion: https://postgr.es/m/2976982.1748049023@sss.pgh.pa.us
Files
| Path | Change | +/− |
|---|---|---|
| contrib/dblink/dblink.c | modified | +27 −69 |
| contrib/postgres_fdw/connection.c | modified | +16 −36 |
| contrib/postgres_fdw/postgres_fdw.c | modified | +36 −127 |
| contrib/postgres_fdw/postgres_fdw.h | modified | +1 −1 |
| src/backend/replication/libpqwalreceiver/libpqwalreceiver.c | modified | +2 −29 |
| src/include/libpq/libpq-be-fe-helpers.h | modified | +1 −12 |
Discussion
- Fixing memory leaks in postgres_fdw 17 messages · 2025-05-24 → 2025-07-26