Re: Remove HeapTupleheaderSetXmin{Committed,Invalid} functions - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Remove HeapTupleheaderSetXmin{Committed,Invalid} functions
Date
Msg-id aFuwI4py4k-S42FP@paquier.xyz
Whole thread Raw
Responses Re: Remove HeapTupleheaderSetXmin{Committed,Invalid} functions
List 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

Attachment

pgsql-hackers by date:

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