xmax is the second half of every visibility check: the transaction id that deleted or superseded a row version. A DELETE stamps it on the current version; an UPDATE stamps it on the old version while writing the new one. It is set and never cleared: the version stays on disk, invisible to new snapshots, until vacuum removes it. A row with an empty xmax is simply alive.
DEMO — toy table, 4 rowsnext xid 4711
ctidxminxmaxpayloadvisibility
(0,1)4702—'checkout'visible
(0,2)4703—'signup'visible
(0,3)4707—'refund'visible
(0,4)4710—'login'visible
LIVE / DEAD TUPLES
4 / 0
HEAP VERSIONS ON DISK
4
OPEN SNAPSHOT
none
UPDATE writes a new version and stamps the old row’s xmax. Open a snapshot first to see vacuum blocked.
xmax also stores lock information: SELECT … FOR UPDATE writes a locker xid (or a multixact id) into xmax without killing the row. The demo shows only the delete/supersede meaning.