pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Reap the benefits of not having to avoid leaking PGresults.
Date: Fri, 25 Jul 2025 20:42:52 +0000
Message-ID: <E1ufPFk-000j9G-0G@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/80aa9848befc13c188d2775a859deaf172fdd3a2

Modified Files
--------------
contrib/dblink/dblink.c                            |  96 ++++--------
contrib/postgres_fdw/connection.c                  |  52 ++-----
contrib/postgres_fdw/postgres_fdw.c                | 163 +++++----------------
contrib/postgres_fdw/postgres_fdw.h                |   2 +-
.../libpqwalreceiver/libpqwalreceiver.c            |  31 +---
src/include/libpq/libpq-be-fe-helpers.h            |  13 +-
6 files changed, 83 insertions(+), 274 deletions(-)



Message-ID: <E1ufPFk-000j9G-0G@gemulon.postgresql.org>
Permalink:  ../E1ufPFk-000j9G-0G@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ufPFk-000j9G-0G@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Reap the benefits of not having to avoid leaking PGresults.
  In-Reply-To: <E1ufPFk-000j9G-0G@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox