Re: Remove HeapTupleheaderSetXmin{Committed,Invalid} functions

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andy Fan <zhihuifan1213(at)163(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Remove HeapTupleheaderSetXmin{Committed,Invalid} functions
Date: 2025-06-25 08:15:31
Message-ID: aFuwI4py4k-S42FP@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 25, 2025 at 07:47:27AM +0000, Andy Fan wrote:
> When I am reading the code, I first thought I can do something in
> HeapTupleheaderSetXminCommitted, then I realized we have SetHintBits.
> After some research, I find HeapTupleHeaderSetXminCommitted is never
> used and it looks not safe to use after comparing with SetHintBits. So
> to avoid future confusion or misuse, I'd suggest to remove it. I think
> HeapTupleHeaderSetXminInvalid should be the same. So here is the patch.

There is a cost in removing such code, even if not used in core:
extension code outside of core may use it, and they would fail to
compile. This can break code, and keeping them around has no
maintenance cost.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2025-06-25 08:25:34 Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly
Previous Message Peter Eisentraut 2025-06-25 08:11:28 Re: pg18: Virtual generated columns are not (yet) safe when superuser selects from them