Re: [PATCH] Fix improper tuple deallocation in import_pg_statist()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tomas Vondra <tomas(at)vondra(dot)me>
Cc: yonghao_lee <yonghao_lee(at)qq(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Fix improper tuple deallocation in import_pg_statist()
Date: 2026-03-06 06:06:05
Message-ID: aapuzad2hYaCc1dK@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 05, 2026 at 02:01:32AM +0100, Tomas Vondra wrote:
> Except that heap_freetuple is defined like this:
>
> void
> heap_freetuple(HeapTuple htup)
> {
> pfree(htup);
> }
>
> so this does not change anything. This report seems to miss how tuples
> are allocated in heap_form_tuple.

Right, what is obviously an LLM analysis forgot the context of how
HeapTuple allocations happen when these are formed.

Saying that, this is new code, that I had the idea to commit like
this, and I don't like fresh inconsistencies. We also use
heap_freetuple() in upsert_pg_statistic_ext_data(). Hence, at the
end, done. It was harmless as-is, still..
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-03-06 06:15:37 Re: Improve checks for GUC recovery_target_xid
Previous Message Xuneng Zhou 2026-03-06 06:06:01 Re: Add pg_stat_recovery system view