]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Use relation_close() more consistently in contrib/
authorMichael Paquier <michael@paquier.xyz>
Tue, 6 Jan 2026 07:17:59 +0000 (16:17 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 6 Jan 2026 07:17:59 +0000 (16:17 +0900)
commit8b9b93e39b10ce32577eca3c84face880fc8aff0
treed014538f70fcaa0eb8004adc3598bcd0f98c2cc4
parentf1e251be80a05cb66191d5ea48f2cdc3acff72b5
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
contrib/pageinspect/hashfuncs.c
contrib/pgstattuple/pgstatindex.c