Re: Fix memory leak in gist_page_items() of pageinspect
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Chao Li <li.evan.chao@gmail.com>, Daniel Gustafsson <daniel@yesql.se>, Heikki Linnakangas <hlinnaka@iki.fi>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-12-18T23:01:54Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Use relation_close() more consistently in contrib/
- 8b9b93e39b10 19 (unreleased) landed
-
Use table/index_close() more consistently
- 9d0f7996e58c 19 (unreleased) landed
-
pageinspect: use index_close() for GiST index relation
- 171198ff2a57 19 (unreleased) landed
On Wed, Dec 17, 2025 at 11:57:13AM +0000, Bertrand Drouvot wrote: > Please note that for hash_bitmap_info() and pgstathashindex() the open calls are > changed instead. For those we keep the IS_INDEX() checks to reject partitioned > indexes (which index_open() accepts via validate_relation_kind()). So, that also > changes the error messages in some tests. If we do prefer the previous error > messages we could change the close calls instead (I prefer the way it's done > in the attached though). I have noticed that the two surrounding relation_close() calls for the parent tables did not get the notice of the change for brin.c of what you are doing for the indexes, while we use table_open(). I have fixed these. It would be nicer if IS_INDEX() could be removed in the other code paths you are suggesting to change, but the partitioned index argument also means that we would have two code paths in charge of a relkind check instead of one. Just using relation_*() may be cleaner. -- Michael