Re: Fix memory leak in gist_page_items() of pageinspect

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Japin Li <japinli(at)hotmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, 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-22 02:41:44
Message-ID: 5484DB5D-813C-4743-8BD1-7DF677FA5D98@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Dec 19, 2025, at 18:26, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
>
> Hi,
>
> On Fri, Dec 19, 2025 at 05:36:51PM +0800, Japin Li wrote:
>> On Fri, 19 Dec 2025 at 08:23, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
>>> 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.
>>> "
>>>
>>
>> LGTM.
>
> Thanks! Done that way in the attached.
>
> Regards,
>
> --
> Bertrand Drouvot
> PostgreSQL Contributors Team
> RDS Open Source Databases
> Amazon Web Services: https://aws.amazon.com
> <v3-0001-Use-relation_close-more-consistently.patch>

LGTM. As the immediately following statement is if (!IS_INDEX(rel)), adding a comment to relation_open() feels very necessary.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2025-12-22 02:59:12 Re: A few patches to clarify snapshot management, part 2
Previous Message Kevin K Biju 2025-12-22 02:30:00 Allowing ALTER COLUMN TYPE for columns in publication column lists