pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use relation_close() more consistently in contrib/
Date: Tue, 06 Jan 2026 07:29:16 +0000
Message-ID: <E1vd1VD-004oCH-1T@gemulon.postgresql.org> (raw)

Use relation_close() more consistently in contrib/

All the code paths updated here have been using index_close() to
close a relation that was opened with relation_open(), in pgstattuple
and pageinspect.  index_close() does the same thing as relation_close(),
so there is no harm, but being inconsistent could lead to issues if the
internals of these close() functions begin to introduce some specific
logic in the future.

In passing, this commit adds some comments explaining why we are using
relation_open() instead of index_open() in a few places, which is due to
the fact that partitioned indexes are not allowed in these functions.

Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Japin Li <japinli@hotmail.com>
Discussion: https://postgr.es/m/aUKamYGiDKO6byp5@ip-10-97-1-34.eu-west-3.compute.internal

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8b9b93e39b10ce32577eca3c84face880fc8aff0

Modified Files
--------------
contrib/pageinspect/hashfuncs.c   |  6 +++++-
contrib/pgstattuple/pgstatindex.c | 10 +++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)



Message-ID: <E1vd1VD-004oCH-1T@gemulon.postgresql.org>
Permalink:  ../E1vd1VD-004oCH-1T@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vd1VD-004oCH-1T@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: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Use relation_close() more consistently in contrib/
  In-Reply-To: <E1vd1VD-004oCH-1T@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