pgsql: Use relation_close() more consistently in contrib/ - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Use relation_close() more consistently in contrib/
Date
Msg-id E1vd1VD-004oCH-1T@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Allow bgworkers to be terminated for database-related commands
Next
From: Alexander Korotkov
Date:
Subject: pgsql: Fix variable usage in wakeupWaiters()