Re: Fix memory leak in gist_page_items() of pageinspect - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Fix memory leak in gist_page_items() of pageinspect
Date
Msg-id aUULfLEf4JQMWkWI@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Fix memory leak in gist_page_items() of pageinspect  (Japin Li <japinli@hotmail.com>)
List pgsql-hackers
Hi,

On Fri, Dec 19, 2025 at 02:21:40PM +0800, Japin Li wrote:
> On Fri, 19 Dec 2025 at 04:29, Bertrand Drouvot <bertranddrouvot.pg@gmail.com> wrote:
> > Yeah, and removing IS_INDEX() and adding a check for partitioned indexes would
> > still mean 2 code paths. So, v2 changes the close calls (and that's consistent
> > with what pgstatginindex_internal() is doing.
> >
> 
> It would be reasonable to add a comment explaining the choice of
> relation_open()/relation_close() instead of the index-specific
> index_open()/index_close().

Yeah that would not hurt. What about before the relation_open() calls?

"
Use relation_open() and not index_open() to avoid the validate_relation_kind()
check as we handle relation validation separately below.
"

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: Improve logical replication usability when tables lack primary keys
Next
From: Masahiko Sawada
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication