Re: [PATCH] Fix improper tuple deallocation in import_pg_statist() - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [PATCH] Fix improper tuple deallocation in import_pg_statist()
Date
Msg-id aapuzad2hYaCc1dK@paquier.xyz
Whole thread Raw
In response to Re: [PATCH] Fix improper tuple deallocation in import_pg_statist()  (Tomas Vondra <tomas@vondra.me>)
List 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

Attachment

pgsql-hackers by date:

Previous
From: Xuneng Zhou
Date:
Subject: Re: Add pg_stat_recovery system view
Next
From: Michael Paquier
Date:
Subject: Re: Improve checks for GUC recovery_target_xid