Re: Fix memory leak in gist_page_items() of pageinspect

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix memory leak in gist_page_items() of pageinspect
Date: 2025-12-19 08:23:24
Message-ID: aUULfLEf4JQMWkWI@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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(dot)pg(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-12-19 08:27:24 Re: Proposal: Conflict log history table for Logical Replication
Previous Message Chao Li 2025-12-19 08:08:39 Re: Improve logical replication usability when tables lack primary keys