Re: Remove HeapTupleheaderSetXmin{Committed,Invalid} functions

Álvaro Herrera <alvherre@kurilemu.de>

From: Álvaro Herrera <alvherre@kurilemu.de>
To: Andy Fan <zhihuifan1213@163.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-06-26T12:06:34Z
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

Hmm

So these functions were created from macros in commit 34694ec888d6,
which themselves had been added for the first time in commit
37484ad2aace.  However, it appears that they were added only because
they were mirroring HeapTupleHeaderSetXminFrozen(), and while the latter
was immediately used, the other two weren't and never have been.

(For a short while between June and September 2002 we had a different
macro also called HeapTupleHeaderSetXminInvalid -- added by commit
3c35face4108 and removed by commit c7a165adc64e -- and curiously enough
it was also entirely unused.)

I think Andy is right that these should be removed, not only because
they are unsafe but because they are dead code.

codesearch.debian.net shows no matches by grep, other than
htup_internals.h itself.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"La rebeldía es la virtud original del hombre" (Arthur Schopenhauer)