Re: Remove HeapTupleheaderSetXmin{Committed,Invalid} functions

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Andy Fan <zhihuifan1213@163.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-06-25T08:15:31Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Remove HeapTupleheaderSetXminCommitted/Invalid functions

  2. Convert macros to static inline functions (htup_details.h, itup.h)

  3. Change the way we mark tuples as frozen.

  4. Code review for HeapTupleHeader changes. Add version number to page headers

  5. This patch wraps all accesses to t_xmin, t_cmin, t_xmax, and t_cmax in

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