diff -ur ../orig/src/backend/access/common/heaptuple.c src/backend/access/common/heaptuple.c
--- ../orig/src/backend/access/common/heaptuple.c	2002-05-27 23:52:40.000000000 +0200
+++ src/backend/access/common/heaptuple.c	2002-06-10 15:40:45.000000000 +0200
@@ -439,16 +439,16 @@
 			result = ObjectIdGetDatum(tup->t_data->t_oid);
 			break;
 		case MinTransactionIdAttributeNumber:
-			result = TransactionIdGetDatum(tup->t_data->t_xmin);
+			result = TransactionIdGetDatum(HeapTupleHeaderGetXmin(tup->t_data));
 			break;
 		case MinCommandIdAttributeNumber:
-			result = CommandIdGetDatum(tup->t_data->t_cmin);
+			result = CommandIdGetDatum(HeapTupleHeaderGetCmin(tup->t_data));
 			break;
 		case MaxTransactionIdAttributeNumber:
-			result = TransactionIdGetDatum(tup->t_data->t_xmax);
+			result = TransactionIdGetDatum(HeapTupleHeaderGetXmax(tup->t_data));
 			break;
 		case MaxCommandIdAttributeNumber:
-			result = CommandIdGetDatum(tup->t_data->t_cmax);
+			result = CommandIdGetDatum(HeapTupleHeaderGetCmax(tup->t_data));
 			break;
 		case TableOidAttributeNumber:
 			result = ObjectIdGetDatum(tup->t_tableOid);
diff -ur ../orig/src/backend/access/heap/heapam.c src/backend/access/heap/heapam.c
--- ../orig/src/backend/access/heap/heapam.c	2002-05-27 16:29:36.000000000 +0200
+++ src/backend/access/heap/heapam.c	2002-06-10 16:13:46.000000000 +0200
@@ -1122,10 +1122,10 @@
 			CheckMaxObjectId(tup->t_data->t_oid);
 	}
 
-	TransactionIdStore(GetCurrentTransactionId(), &(tup->t_data->t_xmin));
-	tup->t_data->t_cmin = cid;
-	StoreInvalidTransactionId(&(tup->t_data->t_xmax));
-	tup->t_data->t_cmax = FirstCommandId;
+	HeapTupleHeaderSetXmin(tup->t_data, GetCurrentTransactionId());
+	HeapTupleHeaderSetCmin(tup->t_data, cid);
+	HeapTupleHeaderSetXmaxInvalid(tup->t_data);
+	HeapTupleHeaderSetCmax(tup->t_data, FirstCommandId);
 	tup->t_data->t_infomask &= ~(HEAP_XACT_MASK);
 	tup->t_data->t_infomask |= HEAP_XMAX_INVALID;
 	tup->t_tableOid = relation->rd_id;
@@ -1270,7 +1270,7 @@
 	}
 	else if (result == HeapTupleBeingUpdated)
 	{
-		TransactionId xwait = tp.t_data->t_xmax;
+		TransactionId xwait = HeapTupleHeaderGetXmax(tp.t_data);
 
 		/* sleep until concurrent transaction ends */
 		LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
@@ -1285,7 +1285,7 @@
 		 * update then some other xaction could update this tuple before
 		 * we got to this point.
 		 */
-		if (!TransactionIdEquals(tp.t_data->t_xmax, xwait))
+		if (!TransactionIdEquals(HeapTupleHeaderGetXmax(tp.t_data), xwait))
 			goto l1;
 		if (!(tp.t_data->t_infomask & HEAP_XMAX_COMMITTED))
 		{
@@ -1309,10 +1309,10 @@
 
 	START_CRIT_SECTION();
 	/* store transaction information of xact deleting the tuple */
-	TransactionIdStore(GetCurrentTransactionId(), &(tp.t_data->t_xmax));
-	tp.t_data->t_cmax = cid;
 	tp.t_data->t_infomask &= ~(HEAP_XMAX_COMMITTED |
 							 HEAP_XMAX_INVALID | HEAP_MARKED_FOR_UPDATE);
+	HeapTupleHeaderSetXmax(tp.t_data, GetCurrentTransactionId());
+	HeapTupleHeaderSetCmax(tp.t_data, cid);
 	/* XLOG stuff */
 	{
 		xl_heap_delete xlrec;
@@ -1461,7 +1461,7 @@
 	}
 	else if (result == HeapTupleBeingUpdated)
 	{
-		TransactionId xwait = oldtup.t_data->t_xmax;
+		TransactionId xwait = HeapTupleHeaderGetXmax(oldtup.t_data);
 
 		/* sleep untill concurrent transaction ends */
 		LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
@@ -1476,7 +1476,7 @@
 		 * update then some other xaction could update this tuple before
 		 * we got to this point.
 		 */
-		if (!TransactionIdEquals(oldtup.t_data->t_xmax, xwait))
+		if (!TransactionIdEquals(HeapTupleHeaderGetXmax(oldtup.t_data), xwait))
 			goto l2;
 		if (!(oldtup.t_data->t_infomask & HEAP_XMAX_COMMITTED))
 		{
@@ -1500,11 +1500,11 @@
 
 	/* Fill in OID and transaction status data for newtup */
 	newtup->t_data->t_oid = oldtup.t_data->t_oid;
-	TransactionIdStore(GetCurrentTransactionId(), &(newtup->t_data->t_xmin));
-	newtup->t_data->t_cmin = cid;
-	StoreInvalidTransactionId(&(newtup->t_data->t_xmax));
 	newtup->t_data->t_infomask &= ~(HEAP_XACT_MASK);
 	newtup->t_data->t_infomask |= (HEAP_XMAX_INVALID | HEAP_UPDATED);
+	HeapTupleHeaderSetXmin(newtup->t_data, GetCurrentTransactionId());
+	HeapTupleHeaderSetCmin(newtup->t_data, cid);
+	HeapTupleHeaderSetXmaxInvalid(newtup->t_data);
 
 	/*
 	 * If the toaster needs to be activated, OR if the new tuple will not
@@ -1538,13 +1538,12 @@
 		_locked_tuple_.tid = oldtup.t_self;
 		XactPushRollback(_heap_unlock_tuple, (void *) &_locked_tuple_);
 
-		TransactionIdStore(GetCurrentTransactionId(),
-						   &(oldtup.t_data->t_xmax));
-		oldtup.t_data->t_cmax = cid;
 		oldtup.t_data->t_infomask &= ~(HEAP_XMAX_COMMITTED |
 									   HEAP_XMAX_INVALID |
 									   HEAP_MARKED_FOR_UPDATE);
 		oldtup.t_data->t_infomask |= HEAP_XMAX_UNLOGGED;
+		HeapTupleHeaderSetXmax(oldtup.t_data, GetCurrentTransactionId());
+		HeapTupleHeaderSetCmax(oldtup.t_data, cid);
 		already_marked = true;
 		LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
 
@@ -1630,12 +1629,11 @@
 	}
 	else
 	{
-		TransactionIdStore(GetCurrentTransactionId(),
-						   &(oldtup.t_data->t_xmax));
-		oldtup.t_data->t_cmax = cid;
 		oldtup.t_data->t_infomask &= ~(HEAP_XMAX_COMMITTED |
 									   HEAP_XMAX_INVALID |
 									   HEAP_MARKED_FOR_UPDATE);
+		HeapTupleHeaderSetXmax(oldtup.t_data, GetCurrentTransactionId());
+		HeapTupleHeaderSetCmax(oldtup.t_data, cid);
 	}
 
 	/* record address of new tuple in t_ctid of old one */
@@ -1759,7 +1757,7 @@
 	}
 	else if (result == HeapTupleBeingUpdated)
 	{
-		TransactionId xwait = tuple->t_data->t_xmax;
+		TransactionId xwait = HeapTupleHeaderGetXmax(tuple->t_data);
 
 		/* sleep untill concurrent transaction ends */
 		LockBuffer(*buffer, BUFFER_LOCK_UNLOCK);
@@ -1774,7 +1772,7 @@
 		 * update then some other xaction could update this tuple before
 		 * we got to this point.
 		 */
-		if (!TransactionIdEquals(tuple->t_data->t_xmax, xwait))
+		if (!TransactionIdEquals(HeapTupleHeaderGetXmax(tuple->t_data), xwait))
 			goto l3;
 		if (!(tuple->t_data->t_infomask & HEAP_XMAX_COMMITTED))
 		{
@@ -1802,10 +1800,10 @@
 	((PageHeader) BufferGetPage(*buffer))->pd_sui = ThisStartUpID;
 
 	/* store transaction information of xact marking the tuple */
-	TransactionIdStore(GetCurrentTransactionId(), &(tuple->t_data->t_xmax));
-	tuple->t_data->t_cmax = cid;
 	tuple->t_data->t_infomask &= ~(HEAP_XMAX_COMMITTED | HEAP_XMAX_INVALID);
 	tuple->t_data->t_infomask |= HEAP_MARKED_FOR_UPDATE;
+	HeapTupleHeaderSetXmax(tuple->t_data, GetCurrentTransactionId());
+	HeapTupleHeaderSetCmax(tuple->t_data, cid);
 
 	LockBuffer(*buffer, BUFFER_LOCK_UNLOCK);
 
@@ -1981,15 +1979,17 @@
 	if (move)					/* remember xmin & xmax */
 	{
 		TransactionId xmax;
+		TransactionId xmin;
 
 		if (newtup->t_data->t_infomask & HEAP_XMAX_INVALID ||
 			newtup->t_data->t_infomask & HEAP_MARKED_FOR_UPDATE)
 			xmax = InvalidTransactionId;
 		else
-			xmax = newtup->t_data->t_xmax;
+			xmax = HeapTupleHeaderGetXmax(newtup->t_data);
+		xmin = HeapTupleHeaderGetXmin(newtup->t_data);
 		memcpy((char *) &xlhdr + hsize, &xmax, sizeof(TransactionId));
 		memcpy((char *) &xlhdr + hsize + sizeof(TransactionId),
-			   &(newtup->t_data->t_xmin), sizeof(TransactionId));
+			   &xmin, sizeof(TransactionId));
 		hsize += 2 * sizeof(TransactionId);
 	}
 	rdata[2].buffer = newbuf;
@@ -2126,10 +2126,10 @@
 
 	if (redo)
 	{
-		htup->t_xmax = record->xl_xid;
-		htup->t_cmax = FirstCommandId;
 		htup->t_infomask &= ~(HEAP_XMAX_COMMITTED |
 							  HEAP_XMAX_INVALID | HEAP_MARKED_FOR_UPDATE);
+		HeapTupleHeaderSetXmax(htup, record->xl_xid);
+		HeapTupleHeaderSetCmax(htup, FirstCommandId);
 		PageSetLSN(page, lsn);
 		PageSetSUI(page, ThisStartUpID);
 		UnlockAndWriteBuffer(buffer);
@@ -2201,11 +2201,11 @@
 		htup->t_oid = xlhdr.t_oid;
 		htup->t_natts = xlhdr.t_natts;
 		htup->t_hoff = xlhdr.t_hoff;
-		htup->t_xmin = record->xl_xid;
-		htup->t_cmin = FirstCommandId;
-		htup->t_xmax = InvalidTransactionId;
-		htup->t_cmax = FirstCommandId;
 		htup->t_infomask = HEAP_XMAX_INVALID | xlhdr.mask;
+		HeapTupleHeaderSetXmin(htup, record->xl_xid);
+		HeapTupleHeaderSetCmin(htup, FirstCommandId);
+		HeapTupleHeaderSetXmax(htup, InvalidTransactionId);
+		HeapTupleHeaderSetCmax(htup, FirstCommandId);
 
 		offnum = PageAddItem(page, (Item) htup, newlen, offnum,
 							 LP_USED | OverwritePageMode);
@@ -2286,17 +2286,17 @@
 	{
 		if (move)
 		{
-			TransactionIdStore(record->xl_xid, (TransactionId *) &(htup->t_cmin));
 			htup->t_infomask &=
 				~(HEAP_XMIN_COMMITTED | HEAP_XMIN_INVALID | HEAP_MOVED_IN);
 			htup->t_infomask |= HEAP_MOVED_OFF;
+			HeapTupleHeaderSetXvac(htup, record->xl_xid);
 		}
 		else
 		{
-			htup->t_xmax = record->xl_xid;
-			htup->t_cmax = FirstCommandId;
 			htup->t_infomask &= ~(HEAP_XMAX_COMMITTED |
 							 HEAP_XMAX_INVALID | HEAP_MARKED_FOR_UPDATE);
+			HeapTupleHeaderSetXmax(htup, record->xl_xid);
+			HeapTupleHeaderSetCmax(htup, FirstCommandId);
 		}
 		if (samepage)
 			goto newsame;
@@ -2372,26 +2372,27 @@
 		htup->t_hoff = xlhdr.t_hoff;
 		if (move)
 		{
+			TransactionId xmax;
+			TransactionId xmin;
+			
 			hsize = SizeOfHeapUpdate + SizeOfHeapHeader;
-			memcpy(&(htup->t_xmax),
-				   (char *) xlrec + hsize,
-				   sizeof(TransactionId));
-			memcpy(&(htup->t_xmin),
-				   (char *) xlrec + hsize + sizeof(TransactionId),
-				   sizeof(TransactionId));
-			TransactionIdStore(record->xl_xid, (TransactionId *) &(htup->t_cmin));
+			memcpy(&xmax, (char *) xlrec + hsize, sizeof(TransactionId));
+			memcpy(&xmin, (char *) xlrec + hsize + sizeof(TransactionId), sizeof(TransactionId));
 			htup->t_infomask = xlhdr.mask;
 			htup->t_infomask &= ~(HEAP_XMIN_COMMITTED |
 								  HEAP_XMIN_INVALID | HEAP_MOVED_OFF);
 			htup->t_infomask |= HEAP_MOVED_IN;
+			HeapTupleHeaderSetXmin(htup, xmin);
+			HeapTupleHeaderSetXmax(htup, xmax);
+			HeapTupleHeaderSetXvac(htup, record->xl_xid);
 		}
 		else
 		{
-			htup->t_xmin = record->xl_xid;
-			htup->t_cmin = FirstCommandId;
-			htup->t_xmax = InvalidTransactionId;
-			htup->t_cmax = FirstCommandId;
 			htup->t_infomask = HEAP_XMAX_INVALID | xlhdr.mask;
+			HeapTupleHeaderSetXmin(htup, record->xl_xid);
+			HeapTupleHeaderSetCmin(htup, FirstCommandId);
+			HeapTupleHeaderSetXmaxInvalid(htup);
+			HeapTupleHeaderSetCmax(htup, FirstCommandId);
 		}
 
 		offnum = PageAddItem(page, (Item) htup, newlen, offnum,
@@ -2445,7 +2446,7 @@
 
 	htup = (HeapTupleHeader) PageGetItem(page, lp);
 
-	if (!TransactionIdEquals(htup->t_xmax, GetCurrentTransactionId()))
+	if (!TransactionIdEquals(HeapTupleHeaderGetXmax(htup), GetCurrentTransactionId()))
 		elog(PANIC, "_heap_unlock_tuple: invalid xmax in rollback");
 	htup->t_infomask &= ~HEAP_XMAX_UNLOGGED;
 	htup->t_infomask |= HEAP_XMAX_INVALID;
diff -ur ../orig/src/backend/access/transam/xlogutils.c src/backend/access/transam/xlogutils.c
--- ../orig/src/backend/access/transam/xlogutils.c	2002-03-31 08:26:29.000000000 +0200
+++ src/backend/access/transam/xlogutils.c	2002-06-10 15:40:46.000000000 +0200
@@ -73,7 +73,8 @@
 	htup = (HeapTupleHeader) PageGetItem(page, lp);
 
 	Assert(PageGetSUI(page) == ThisStartUpID);
-	if (!TransactionIdEquals(htup->t_xmin, xid) || htup->t_cmin != cid)
+	if (!TransactionIdEquals(HeapTupleHeaderGetXmin(htup), xid) ||
+		HeapTupleHeaderGetCmin(htup) != cid)
 	{
 		UnlockAndReleaseBuffer(buffer);
 		return (-1);
@@ -137,8 +138,8 @@
 	{
 		if (htup->t_infomask & HEAP_XMIN_INVALID ||
 			(htup->t_infomask & HEAP_MOVED_IN &&
-			 TransactionIdDidAbort((TransactionId) htup->t_cmin)) ||
-			TransactionIdDidAbort(htup->t_xmin))
+			 TransactionIdDidAbort(HeapTupleHeaderGetXvac(htup))) ||
+			TransactionIdDidAbort(HeapTupleHeaderGetXmin(htup)))
 		{
 			UnlockAndReleaseBuffer(buffer);
 			return (false);
diff -ur ../orig/src/backend/catalog/index.c src/backend/catalog/index.c
--- ../orig/src/backend/catalog/index.c	2002-05-27 16:29:37.000000000 +0200
+++ src/backend/catalog/index.c	2002-06-10 15:40:46.000000000 +0200
@@ -1621,7 +1621,8 @@
 					 * (Consider INSERT followed by CREATE INDEX within a
 					 * transaction.)
 					 */
-					if (!TransactionIdIsCurrentTransactionId(heapTuple->t_data->t_xmin))
+					if (!TransactionIdIsCurrentTransactionId(
+							HeapTupleHeaderGetXmin(heapTuple->t_data)))
 						elog(ERROR, "IndexBuildHeapScan: concurrent insert in progress");
 					indexIt = true;
 					tupleIsAlive = true;
@@ -1635,7 +1636,8 @@
 					 * (Consider DELETE followed by CREATE INDEX within a
 					 * transaction.)
 					 */
-					if (!TransactionIdIsCurrentTransactionId(heapTuple->t_data->t_xmax))
+					if (!TransactionIdIsCurrentTransactionId(
+							HeapTupleHeaderGetXmax(heapTuple->t_data)))
 						elog(ERROR, "IndexBuildHeapScan: concurrent delete in progress");
 					indexIt = true;
 					tupleIsAlive = false;
diff -ur ../orig/src/backend/commands/sequence.c src/backend/commands/sequence.c
--- ../orig/src/backend/commands/sequence.c	2002-05-27 16:29:37.000000000 +0200
+++ src/backend/commands/sequence.c	2002-06-10 15:40:46.000000000 +0200
@@ -249,10 +249,10 @@
 		itemId = PageGetItemId((Page) page, FirstOffsetNumber);
 		item = PageGetItem((Page) page, itemId);
 
-		((HeapTupleHeader) item)->t_xmin = FrozenTransactionId;
+		HeapTupleHeaderSetXmin((HeapTupleHeader) item, FrozenTransactionId);
 		((HeapTupleHeader) item)->t_infomask |= HEAP_XMIN_COMMITTED;
 
-		tuple->t_data->t_xmin = FrozenTransactionId;
+		HeapTupleHeaderSetXmin(tuple->t_data, FrozenTransactionId);
 		tuple->t_data->t_infomask |= HEAP_XMIN_COMMITTED;
 	}
 
diff -ur ../orig/src/backend/commands/vacuum.c src/backend/commands/vacuum.c
--- ../orig/src/backend/commands/vacuum.c	2002-05-27 16:29:38.000000000 +0200
+++ src/backend/commands/vacuum.c	2002-06-10 15:40:46.000000000 +0200
@@ -1064,11 +1064,11 @@
 					 * Tuple is good.  Consider whether to replace its
 					 * xmin value with FrozenTransactionId.
 					 */
-					if (TransactionIdIsNormal(tuple.t_data->t_xmin) &&
-						TransactionIdPrecedes(tuple.t_data->t_xmin,
+					if (TransactionIdIsNormal(HeapTupleHeaderGetXmin(tuple.t_data)) &&
+						TransactionIdPrecedes(HeapTupleHeaderGetXmin(tuple.t_data),
 											  FreezeLimit))
 					{
-						tuple.t_data->t_xmin = FrozenTransactionId;
+						HeapTupleHeaderSetXmin(tuple.t_data, FrozenTransactionId);
 						/* infomask should be okay already */
 						Assert(tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED);
 						pgchanged = true;
@@ -1111,7 +1111,7 @@
 					 * lock on the relation; shouldn't we raise an error?
 					 */
 					elog(WARNING, "Rel %s: TID %u/%u: InsertTransactionInProgress %u - can't shrink relation",
-						 relname, blkno, offnum, tuple.t_data->t_xmin);
+						 relname, blkno, offnum, HeapTupleHeaderGetXmin(tuple.t_data));
 					do_shrinking = false;
 					break;
 				case HEAPTUPLE_DELETE_IN_PROGRESS:
@@ -1121,7 +1121,7 @@
 					 * lock on the relation; shouldn't we raise an error?
 					 */
 					elog(WARNING, "Rel %s: TID %u/%u: DeleteTransactionInProgress %u - can't shrink relation",
-						 relname, blkno, offnum, tuple.t_data->t_xmax);
+						 relname, blkno, offnum, HeapTupleHeaderGetXmax(tuple.t_data));
 					do_shrinking = false;
 					break;
 				default:
@@ -1497,8 +1497,8 @@
 
 			if (!(tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED))
 			{
-				if ((TransactionId) tuple.t_data->t_cmin != myXID)
-					elog(ERROR, "Invalid XID in t_cmin");
+				if (HeapTupleHeaderGetXvac(tuple.t_data) != myXID)
+					elog(ERROR, "Invalid XVAC in tuple header");
 				if (tuple.t_data->t_infomask & HEAP_MOVED_IN)
 					elog(ERROR, "HEAP_MOVED_IN was not expected");
 
@@ -1542,7 +1542,8 @@
 			 * tuples to another places.
 			 */
 			if ((tuple.t_data->t_infomask & HEAP_UPDATED &&
-			 !TransactionIdPrecedes(tuple.t_data->t_xmin, OldestXmin)) ||
+			 !TransactionIdPrecedes(HeapTupleHeaderGetXmin(tuple.t_data),
+			                        OldestXmin)) ||
 				(!(tuple.t_data->t_infomask & HEAP_XMAX_INVALID) &&
 				 !(ItemPointerEquals(&(tuple.t_self),
 									 &(tuple.t_data->t_ctid)))))
@@ -1659,7 +1660,8 @@
 
 					/* All done ? */
 					if (!(tp.t_data->t_infomask & HEAP_UPDATED) ||
-					TransactionIdPrecedes(tp.t_data->t_xmin, OldestXmin))
+					    TransactionIdPrecedes(HeapTupleHeaderGetXmin(tp.t_data),
+					                          OldestXmin))
 						break;
 
 					/* Well, try to find tuple with old row version */
@@ -1707,8 +1709,8 @@
 						 * latter, and we are too close to 6.5 release. -
 						 * vadim 06/11/99
 						 */
-						if (!(TransactionIdEquals(Ptp.t_data->t_xmax,
-												  tp.t_data->t_xmin)))
+						if (!(TransactionIdEquals(HeapTupleHeaderGetXmax(Ptp.t_data),
+												  HeapTupleHeaderGetXmin(tp.t_data))))
 						{
 							if (freeCbuf)
 								ReleaseBuffer(Cbuf);
@@ -1733,14 +1735,13 @@
 						 * removed.
 						 */
 						if (Ptp.t_data->t_infomask & HEAP_UPDATED &&
-							TransactionIdEquals(Ptp.t_data->t_xmin,
-												Ptp.t_data->t_xmax))
+							TransactionIdEquals(HeapTupleHeaderGetXmin(Ptp.t_data),
+												HeapTupleHeaderGetXmax(Ptp.t_data)))
 						{
-							TransactionIdStore(myXID,
-								(TransactionId *) &(Ptp.t_data->t_cmin));
 							Ptp.t_data->t_infomask &=
 								~(HEAP_XMIN_COMMITTED | HEAP_XMIN_INVALID | HEAP_MOVED_IN);
 							Ptp.t_data->t_infomask |= HEAP_MOVED_OFF;
+							HeapTupleHeaderSetXvac(Ptp.t_data, myXID);
 							WriteBuffer(Pbuf);
 							continue;
 						}
@@ -1804,10 +1805,10 @@
 					/* NO ELOG(ERROR) TILL CHANGES ARE LOGGED */
 					START_CRIT_SECTION();
 
-					TransactionIdStore(myXID, (TransactionId *) &(tuple.t_data->t_cmin));
 					tuple.t_data->t_infomask &=
 						~(HEAP_XMIN_COMMITTED | HEAP_XMIN_INVALID | HEAP_MOVED_IN);
 					tuple.t_data->t_infomask |= HEAP_MOVED_OFF;
+					HeapTupleHeaderSetXvac(tuple.t_data, myXID);
 
 					/*
 					 * If this page was not used before - clean it.
@@ -1844,10 +1845,10 @@
 					 * Update the state of the copied tuple, and store it
 					 * on the destination page.
 					 */
-					TransactionIdStore(myXID, (TransactionId *) &(newtup.t_data->t_cmin));
 					newtup.t_data->t_infomask &=
 						~(HEAP_XMIN_COMMITTED | HEAP_XMIN_INVALID | HEAP_MOVED_OFF);
 					newtup.t_data->t_infomask |= HEAP_MOVED_IN;
+					HeapTupleHeaderSetXvac(newtup.t_data, myXID);
 					newoff = PageAddItem(ToPage, (Item) newtup.t_data, tuple_len,
 										 InvalidOffsetNumber, LP_USED);
 					if (newoff == InvalidOffsetNumber)
@@ -1973,10 +1974,10 @@
 			 * Mark new tuple as moved_in by vacuum and store vacuum XID
 			 * in t_cmin !!!
 			 */
-			TransactionIdStore(myXID, (TransactionId *) &(newtup.t_data->t_cmin));
 			newtup.t_data->t_infomask &=
 				~(HEAP_XMIN_COMMITTED | HEAP_XMIN_INVALID | HEAP_MOVED_OFF);
 			newtup.t_data->t_infomask |= HEAP_MOVED_IN;
+			HeapTupleHeaderSetXvac(newtup.t_data, myXID);
 
 			/* add tuple to the page */
 			newoff = PageAddItem(ToPage, (Item) newtup.t_data, tuple_len,
@@ -1999,10 +2000,10 @@
 			 * Mark old tuple as moved_off by vacuum and store vacuum XID
 			 * in t_cmin !!!
 			 */
-			TransactionIdStore(myXID, (TransactionId *) &(tuple.t_data->t_cmin));
 			tuple.t_data->t_infomask &=
 				~(HEAP_XMIN_COMMITTED | HEAP_XMIN_INVALID | HEAP_MOVED_IN);
 			tuple.t_data->t_infomask |= HEAP_MOVED_OFF;
+			HeapTupleHeaderSetXvac(tuple.t_data, myXID);
 
 			{
 				XLogRecPtr	recptr =
@@ -2050,8 +2051,8 @@
 				tuple.t_data = (HeapTupleHeader) PageGetItem(page, itemid);
 				if (tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED)
 					continue;
-				if ((TransactionId) tuple.t_data->t_cmin != myXID)
-					elog(ERROR, "Invalid XID in t_cmin (4)");
+				if (HeapTupleHeaderGetXvac(tuple.t_data) != myXID)
+					elog(ERROR, "Invalid XVAC in tuple header (4)");
 				if (tuple.t_data->t_infomask & HEAP_MOVED_IN)
 					elog(ERROR, "HEAP_MOVED_IN was not expected (2)");
 				if (tuple.t_data->t_infomask & HEAP_MOVED_OFF)
@@ -2188,8 +2189,8 @@
 			tuple.t_data = (HeapTupleHeader) PageGetItem(page, itemid);
 			if (!(tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED))
 			{
-				if ((TransactionId) tuple.t_data->t_cmin != myXID)
-					elog(ERROR, "Invalid XID in t_cmin (2)");
+				if (HeapTupleHeaderGetXvac(tuple.t_data) != myXID)
+					elog(ERROR, "Invalid XVAC in tuple header (2)");
 				if (tuple.t_data->t_infomask & HEAP_MOVED_IN)
 				{
 					tuple.t_data->t_infomask |= HEAP_XMIN_COMMITTED;
@@ -2267,8 +2268,8 @@
 
 				if (!(tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED))
 				{
-					if ((TransactionId) tuple.t_data->t_cmin != myXID)
-						elog(ERROR, "Invalid XID in t_cmin (3)");
+					if (HeapTupleHeaderGetXvac(tuple.t_data) != myXID)
+						elog(ERROR, "Invalid XVAC in tuple header (3)");
 					if (tuple.t_data->t_infomask & HEAP_MOVED_OFF)
 					{
 						itemid->lp_flags &= ~LP_USED;
diff -ur ../orig/src/backend/commands/vacuumlazy.c src/backend/commands/vacuumlazy.c
--- ../orig/src/backend/commands/vacuumlazy.c	2002-04-02 03:03:05.000000000 +0200
+++ src/backend/commands/vacuumlazy.c	2002-06-10 15:40:46.000000000 +0200
@@ -332,11 +332,11 @@
 					 * assumption by momentarily acquiring exclusive lock,
 					 * but for the moment I see no need to.
 					 */
-					if (TransactionIdIsNormal(tuple.t_data->t_xmin) &&
-						TransactionIdPrecedes(tuple.t_data->t_xmin,
+					if (TransactionIdIsNormal(HeapTupleHeaderGetXmin(tuple.t_data)) &&
+						TransactionIdPrecedes(HeapTupleHeaderGetXmin(tuple.t_data),
 											  FreezeLimit))
 					{
-						tuple.t_data->t_xmin = FrozenTransactionId;
+						HeapTupleHeaderSetXmin(tuple.t_data, FrozenTransactionId);
 						/* infomask should be okay already */
 						Assert(tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED);
 						pgchanged = true;
diff -ur ../orig/src/backend/utils/time/tqual.c src/backend/utils/time/tqual.c
--- ../orig/src/backend/utils/time/tqual.c	2002-05-27 16:29:39.000000000 +0200
+++ src/backend/utils/time/tqual.c	2002-06-10 16:29:22.000000000 +0200
@@ -73,11 +73,11 @@
 
 		if (tuple->t_infomask & HEAP_MOVED_OFF)
 		{
-			if (TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 				return false;
-			if (!TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+			if (!TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 			{
-				if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+				if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 				{
 					tuple->t_infomask |= HEAP_XMIN_INVALID;
 					return false;
@@ -87,11 +87,11 @@
 		}
 		else if (tuple->t_infomask & HEAP_MOVED_IN)
 		{
-			if (!TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (!TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 			{
-				if (TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+				if (TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 					return false;
-				if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+				if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 					tuple->t_infomask |= HEAP_XMIN_COMMITTED;
 				else
 				{
@@ -100,21 +100,21 @@
 				}
 			}
 		}
-		else if (TransactionIdIsCurrentTransactionId(tuple->t_xmin))
+		else if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmin(tuple)))
 		{
 			if (tuple->t_infomask & HEAP_XMAX_INVALID)	/* xid invalid */
 				return true;
 
-			Assert(TransactionIdIsCurrentTransactionId(tuple->t_xmax));
+			Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple)));
 
 			if (tuple->t_infomask & HEAP_MARKED_FOR_UPDATE)
 				return true;
 
 			return false;
 		}
-		else if (!TransactionIdDidCommit(tuple->t_xmin))
+		else if (!TransactionIdDidCommit(HeapTupleHeaderGetXmin(tuple)))
 		{
-			if (TransactionIdDidAbort(tuple->t_xmin))
+			if (TransactionIdDidAbort(HeapTupleHeaderGetXmin(tuple)))
 				tuple->t_infomask |= HEAP_XMIN_INVALID; /* aborted */
 			return false;
 		}
@@ -134,16 +134,16 @@
 		return false;			/* updated by other */
 	}
 
-	if (TransactionIdIsCurrentTransactionId(tuple->t_xmax))
+	if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple)))
 	{
 		if (tuple->t_infomask & HEAP_MARKED_FOR_UPDATE)
 			return true;
 		return false;
 	}
 
-	if (!TransactionIdDidCommit(tuple->t_xmax))
+	if (!TransactionIdDidCommit(HeapTupleHeaderGetXmax(tuple)))
 	{
-		if (TransactionIdDidAbort(tuple->t_xmax))
+		if (TransactionIdDidAbort(HeapTupleHeaderGetXmax(tuple)))
 			tuple->t_infomask |= HEAP_XMAX_INVALID;		/* aborted */
 		return true;
 	}
@@ -209,11 +209,11 @@
 
 		if (tuple->t_infomask & HEAP_MOVED_OFF)
 		{
-			if (TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 				return false;
-			if (!TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+			if (!TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 			{
-				if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+				if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 				{
 					tuple->t_infomask |= HEAP_XMIN_INVALID;
 					return false;
@@ -223,11 +223,11 @@
 		}
 		else if (tuple->t_infomask & HEAP_MOVED_IN)
 		{
-			if (!TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (!TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 			{
-				if (TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+				if (TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 					return false;
-				if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+				if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 					tuple->t_infomask |= HEAP_XMIN_COMMITTED;
 				else
 				{
@@ -236,27 +236,27 @@
 				}
 			}
 		}
-		else if (TransactionIdIsCurrentTransactionId(tuple->t_xmin))
+		else if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmin(tuple)))
 		{
-			if (tuple->t_cmin >= GetCurrentCommandId())
+			if (HeapTupleHeaderGetCmin(tuple) >= GetCurrentCommandId())
 				return false;	/* inserted after scan started */
 
 			if (tuple->t_infomask & HEAP_XMAX_INVALID)	/* xid invalid */
 				return true;
 
-			Assert(TransactionIdIsCurrentTransactionId(tuple->t_xmax));
+			Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple)));
 
 			if (tuple->t_infomask & HEAP_MARKED_FOR_UPDATE)
 				return true;
 
-			if (tuple->t_cmax >= GetCurrentCommandId())
+			if (HeapTupleHeaderGetCmax(tuple) >= GetCurrentCommandId())
 				return true;	/* deleted after scan started */
 			else
 				return false;	/* deleted before scan started */
 		}
-		else if (!TransactionIdDidCommit(tuple->t_xmin))
+		else if (!TransactionIdDidCommit(HeapTupleHeaderGetXmin(tuple)))
 		{
-			if (TransactionIdDidAbort(tuple->t_xmin))
+			if (TransactionIdDidAbort(HeapTupleHeaderGetXmin(tuple)))
 				tuple->t_infomask |= HEAP_XMIN_INVALID; /* aborted */
 			return false;
 		}
@@ -276,19 +276,19 @@
 		return false;
 	}
 
-	if (TransactionIdIsCurrentTransactionId(tuple->t_xmax))
+	if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple)))
 	{
 		if (tuple->t_infomask & HEAP_MARKED_FOR_UPDATE)
 			return true;
-		if (tuple->t_cmax >= GetCurrentCommandId())
+		if (HeapTupleHeaderGetCmax(tuple) >= GetCurrentCommandId())
 			return true;		/* deleted after scan started */
 		else
 			return false;		/* deleted before scan started */
 	}
 
-	if (!TransactionIdDidCommit(tuple->t_xmax))
+	if (!TransactionIdDidCommit(HeapTupleHeaderGetXmax(tuple)))
 	{
-		if (TransactionIdDidAbort(tuple->t_xmax))
+		if (TransactionIdDidAbort(HeapTupleHeaderGetXmax(tuple)))
 			tuple->t_infomask |= HEAP_XMAX_INVALID;		/* aborted */
 		return true;
 	}
@@ -326,11 +326,11 @@
 
 		if (tuple->t_infomask & HEAP_MOVED_OFF)
 		{
-			if (TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 				return false;
-			if (!TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+			if (!TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 			{
-				if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+				if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 				{
 					tuple->t_infomask |= HEAP_XMIN_INVALID;
 					return false;
@@ -340,11 +340,11 @@
 		}
 		else if (tuple->t_infomask & HEAP_MOVED_IN)
 		{
-			if (!TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (!TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 			{
-				if (TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+				if (TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 					return false;
-				if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+				if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 					tuple->t_infomask |= HEAP_XMIN_COMMITTED;
 				else
 				{
@@ -379,11 +379,11 @@
 
 		if (tuple->t_infomask & HEAP_MOVED_OFF)
 		{
-			if (TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 				return HeapTupleInvisible;
-			if (!TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+			if (!TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 			{
-				if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+				if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 				{
 					tuple->t_infomask |= HEAP_XMIN_INVALID;
 					return HeapTupleInvisible;
@@ -393,11 +393,11 @@
 		}
 		else if (tuple->t_infomask & HEAP_MOVED_IN)
 		{
-			if (!TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (!TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 			{
-				if (TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+				if (TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 					return HeapTupleInvisible;
-				if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+				if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 					tuple->t_infomask |= HEAP_XMIN_COMMITTED;
 				else
 				{
@@ -406,30 +406,30 @@
 				}
 			}
 		}
-		else if (TransactionIdIsCurrentTransactionId(tuple->t_xmin))
+		else if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmin(tuple)))
 		{
-			if (tuple->t_cmin >= curcid)
+			if (HeapTupleHeaderGetCmin(tuple) >= curcid)
 				return HeapTupleInvisible;		/* inserted after scan
 												 * started */
 
 			if (tuple->t_infomask & HEAP_XMAX_INVALID)		/* xid invalid */
 				return HeapTupleMayBeUpdated;
 
-			Assert(TransactionIdIsCurrentTransactionId(tuple->t_xmax));
+			Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple)));
 
 			if (tuple->t_infomask & HEAP_MARKED_FOR_UPDATE)
 				return HeapTupleMayBeUpdated;
 
-			if (tuple->t_cmax >= curcid)
+			if (HeapTupleHeaderGetCmax(tuple) >= curcid)
 				return HeapTupleSelfUpdated;	/* updated after scan
 												 * started */
 			else
 				return HeapTupleInvisible;		/* updated before scan
 												 * started */
 		}
-		else if (!TransactionIdDidCommit(tuple->t_xmin))
+		else if (!TransactionIdDidCommit(HeapTupleHeaderGetXmin(tuple)))
 		{
-			if (TransactionIdDidAbort(tuple->t_xmin))
+			if (TransactionIdDidAbort(HeapTupleHeaderGetXmin(tuple)))
 				tuple->t_infomask |= HEAP_XMIN_INVALID;	/* aborted */
 			return HeapTupleInvisible;
 		}
@@ -449,20 +449,20 @@
 		return HeapTupleUpdated;	/* updated by other */
 	}
 
-	if (TransactionIdIsCurrentTransactionId(tuple->t_xmax))
+	if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple)))
 	{
 		if (tuple->t_infomask & HEAP_MARKED_FOR_UPDATE)
 			return HeapTupleMayBeUpdated;
-		if (tuple->t_cmax >= curcid)
+		if (HeapTupleHeaderGetCmax(tuple) >= curcid)
 			return HeapTupleSelfUpdated;		/* updated after scan
 												 * started */
 		else
 			return HeapTupleInvisible;	/* updated before scan started */
 	}
 
-	if (!TransactionIdDidCommit(tuple->t_xmax))
+	if (!TransactionIdDidCommit(HeapTupleHeaderGetXmax(tuple)))
 	{
-		if (TransactionIdDidAbort(tuple->t_xmax))
+		if (TransactionIdDidAbort(HeapTupleHeaderGetXmax(tuple)))
 		{
 			tuple->t_infomask |= HEAP_XMAX_INVALID;		/* aborted */
 			return HeapTupleMayBeUpdated;
@@ -510,11 +510,11 @@
 
 		if (tuple->t_infomask & HEAP_MOVED_OFF)
 		{
-			if (TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 				return false;
-			if (!TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+			if (!TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 			{
-				if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+				if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 				{
 					tuple->t_infomask |= HEAP_XMIN_INVALID;
 					return false;
@@ -524,11 +524,11 @@
 		}
 		else if (tuple->t_infomask & HEAP_MOVED_IN)
 		{
-			if (!TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (!TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 			{
-				if (TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+				if (TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 					return false;
-				if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+				if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 					tuple->t_infomask |= HEAP_XMIN_COMMITTED;
 				else
 				{
@@ -537,26 +537,26 @@
 				}
 			}
 		}
-		else if (TransactionIdIsCurrentTransactionId(tuple->t_xmin))
+		else if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmin(tuple)))
 		{
 			if (tuple->t_infomask & HEAP_XMAX_INVALID)	/* xid invalid */
 				return true;
 
-			Assert(TransactionIdIsCurrentTransactionId(tuple->t_xmax));
+			Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple)));
 
 			if (tuple->t_infomask & HEAP_MARKED_FOR_UPDATE)
 				return true;
 
 			return false;
 		}
-		else if (!TransactionIdDidCommit(tuple->t_xmin))
+		else if (!TransactionIdDidCommit(HeapTupleHeaderGetXmin(tuple)))
 		{
-			if (TransactionIdDidAbort(tuple->t_xmin))
+			if (TransactionIdDidAbort(HeapTupleHeaderGetXmin(tuple)))
 			{
 				tuple->t_infomask |= HEAP_XMIN_INVALID;
 				return false;
 			}
-			SnapshotDirty->xmin = tuple->t_xmin;
+			SnapshotDirty->xmin = HeapTupleHeaderGetXmin(tuple);
 			/* XXX shouldn't we fall through to look at xmax? */
 			return true;		/* in insertion by other */
 		}
@@ -577,22 +577,22 @@
 		return false;			/* updated by other */
 	}
 
-	if (TransactionIdIsCurrentTransactionId(tuple->t_xmax))
+	if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple)))
 	{
 		if (tuple->t_infomask & HEAP_MARKED_FOR_UPDATE)
 			return true;
 		return false;
 	}
 
-	if (!TransactionIdDidCommit(tuple->t_xmax))
+	if (!TransactionIdDidCommit(HeapTupleHeaderGetXmax(tuple)))
 	{
-		if (TransactionIdDidAbort(tuple->t_xmax))
+		if (TransactionIdDidAbort(HeapTupleHeaderGetXmax(tuple)))
 		{
 			tuple->t_infomask |= HEAP_XMAX_INVALID;		/* aborted */
 			return true;
 		}
 		/* running xact */
-		SnapshotDirty->xmax = tuple->t_xmax;
+		SnapshotDirty->xmax = HeapTupleHeaderGetXmax(tuple);
 		return true;			/* in updation by other */
 	}
 
@@ -641,11 +641,11 @@
 
 		if (tuple->t_infomask & HEAP_MOVED_OFF)
 		{
-			if (TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 				return false;
-			if (!TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+			if (!TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 			{
-				if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+				if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 				{
 					tuple->t_infomask |= HEAP_XMIN_INVALID;
 					return false;
@@ -655,11 +655,11 @@
 		}
 		else if (tuple->t_infomask & HEAP_MOVED_IN)
 		{
-			if (!TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (!TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 			{
-				if (TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+				if (TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 					return false;
-				if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+				if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 					tuple->t_infomask |= HEAP_XMIN_COMMITTED;
 				else
 				{
@@ -668,27 +668,27 @@
 				}
 			}
 		}
-		else if (TransactionIdIsCurrentTransactionId(tuple->t_xmin))
+		else if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmin(tuple)))
 		{
-			if (tuple->t_cmin >= snapshot->curcid)
+			if (HeapTupleHeaderGetCmin(tuple) >= snapshot->curcid)
 				return false;	/* inserted after scan started */
 
 			if (tuple->t_infomask & HEAP_XMAX_INVALID)	/* xid invalid */
 				return true;
 
-			Assert(TransactionIdIsCurrentTransactionId(tuple->t_xmax));
+			Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple)));
 
 			if (tuple->t_infomask & HEAP_MARKED_FOR_UPDATE)
 				return true;
 
-			if (tuple->t_cmax >= snapshot->curcid)
+			if (HeapTupleHeaderGetCmax(tuple) >= snapshot->curcid)
 				return true;	/* deleted after scan started */
 			else
 				return false;	/* deleted before scan started */
 		}
-		else if (!TransactionIdDidCommit(tuple->t_xmin))
+		else if (!TransactionIdDidCommit(HeapTupleHeaderGetXmin(tuple)))
 		{
-			if (TransactionIdDidAbort(tuple->t_xmin))
+			if (TransactionIdDidAbort(HeapTupleHeaderGetXmin(tuple)))
 				tuple->t_infomask |= HEAP_XMIN_INVALID;
 			return false;
 		}
@@ -700,15 +700,19 @@
 	 * By here, the inserting transaction has committed - have to check
 	 * when...
 	 */
-	if (TransactionIdFollowsOrEquals(tuple->t_xmin, snapshot->xmin))
+	if (TransactionIdFollowsOrEquals(HeapTupleHeaderGetXmin(tuple),
+	                                 snapshot->xmin))
 	{
 		uint32		i;
 
-		if (TransactionIdFollowsOrEquals(tuple->t_xmin, snapshot->xmax))
+		if (TransactionIdFollowsOrEquals(HeapTupleHeaderGetXmin(tuple),
+										 snapshot->xmax))
 			return false;
+
 		for (i = 0; i < snapshot->xcnt; i++)
 		{
-			if (TransactionIdEquals(tuple->t_xmin, snapshot->xip[i]))
+			if (TransactionIdEquals(HeapTupleHeaderGetXmin(tuple),
+			                        snapshot->xip[i]))
 				return false;
 		}
 	}
@@ -721,17 +725,17 @@
 
 	if (!(tuple->t_infomask & HEAP_XMAX_COMMITTED))
 	{
-		if (TransactionIdIsCurrentTransactionId(tuple->t_xmax))
+		if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple)))
 		{
-			if (tuple->t_cmax >= snapshot->curcid)
+			if (HeapTupleHeaderGetCmax(tuple) >= snapshot->curcid)
 				return true;	/* deleted after scan started */
 			else
 				return false;	/* deleted before scan started */
 		}
 
-		if (!TransactionIdDidCommit(tuple->t_xmax))
+		if (!TransactionIdDidCommit(HeapTupleHeaderGetXmax(tuple)))
 		{
-			if (TransactionIdDidAbort(tuple->t_xmax))
+			if (TransactionIdDidAbort(HeapTupleHeaderGetXmax(tuple)))
 				tuple->t_infomask |= HEAP_XMAX_INVALID; /* aborted */
 			return true;
 		}
@@ -743,15 +747,16 @@
 	/*
 	 * OK, the deleting transaction committed too ... but when?
 	 */
-	if (TransactionIdFollowsOrEquals(tuple->t_xmax, snapshot->xmin))
+	if (TransactionIdFollowsOrEquals(HeapTupleHeaderGetXmax(tuple), snapshot->xmin))
 	{
 		uint32		i;
 
-		if (TransactionIdFollowsOrEquals(tuple->t_xmax, snapshot->xmax))
+		if (TransactionIdFollowsOrEquals(HeapTupleHeaderGetXmax(tuple),
+		                                 snapshot->xmax))
 			return true;
 		for (i = 0; i < snapshot->xcnt; i++)
 		{
-			if (TransactionIdEquals(tuple->t_xmax, snapshot->xip[i]))
+			if (TransactionIdEquals(HeapTupleHeaderGetXmax(tuple), snapshot->xip[i]))
 				return true;
 		}
 	}
@@ -794,11 +799,11 @@
 			return HEAPTUPLE_DEAD;
 		else if (tuple->t_infomask & HEAP_MOVED_OFF)
 		{
-			if (TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 				return HEAPTUPLE_DELETE_IN_PROGRESS;
-			if (TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+			if (TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 				return HEAPTUPLE_DELETE_IN_PROGRESS;
-			if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+			if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 			{
 				tuple->t_infomask |= HEAP_XMIN_INVALID;
 				return HEAPTUPLE_DEAD;
@@ -807,11 +812,11 @@
 		}
 		else if (tuple->t_infomask & HEAP_MOVED_IN)
 		{
-			if (TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_cmin))
+			if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXvac(tuple)))
 				return HEAPTUPLE_INSERT_IN_PROGRESS;
-			if (TransactionIdIsInProgress((TransactionId) tuple->t_cmin))
+			if (TransactionIdIsInProgress(HeapTupleHeaderGetXvac(tuple)))
 				return HEAPTUPLE_INSERT_IN_PROGRESS;
-			if (TransactionIdDidCommit((TransactionId) tuple->t_cmin))
+			if (TransactionIdDidCommit(HeapTupleHeaderGetXvac(tuple)))
 				tuple->t_infomask |= HEAP_XMIN_COMMITTED;
 			else
 			{
@@ -819,11 +824,11 @@
 				return HEAPTUPLE_DEAD;
 			}
 		}
-		else if (TransactionIdIsInProgress(tuple->t_xmin))
+		else if (TransactionIdIsInProgress(HeapTupleHeaderGetXmin(tuple)))
 			return HEAPTUPLE_INSERT_IN_PROGRESS;
-		else if (TransactionIdDidCommit(tuple->t_xmin))
+		else if (TransactionIdDidCommit(HeapTupleHeaderGetXmin(tuple)))
 			tuple->t_infomask |= HEAP_XMIN_COMMITTED;
-		else if (TransactionIdDidAbort(tuple->t_xmin))
+		else if (TransactionIdDidAbort(HeapTupleHeaderGetXmin(tuple)))
 		{
 			tuple->t_infomask |= HEAP_XMIN_INVALID;
 			return HEAPTUPLE_DEAD;
@@ -858,9 +863,9 @@
 		 */
 		if (!(tuple->t_infomask & HEAP_XMAX_COMMITTED))
 		{
-			if (TransactionIdIsInProgress(tuple->t_xmax))
+			if (TransactionIdIsInProgress(HeapTupleHeaderGetXmax(tuple)))
 				return HEAPTUPLE_LIVE;
-			if (TransactionIdDidCommit(tuple->t_xmax))
+			if (TransactionIdDidCommit(HeapTupleHeaderGetXmax(tuple)))
 				tuple->t_infomask |= HEAP_XMAX_COMMITTED;
 			else				/* it's either aborted or crashed */
 				tuple->t_infomask |= HEAP_XMAX_INVALID;
@@ -870,11 +875,11 @@
 
 	if (!(tuple->t_infomask & HEAP_XMAX_COMMITTED))
 	{
-		if (TransactionIdIsInProgress(tuple->t_xmax))
+		if (TransactionIdIsInProgress(HeapTupleHeaderGetXmax(tuple)))
 			return HEAPTUPLE_DELETE_IN_PROGRESS;
-		else if (TransactionIdDidCommit(tuple->t_xmax))
+		else if (TransactionIdDidCommit(HeapTupleHeaderGetXmax(tuple)))
 			tuple->t_infomask |= HEAP_XMAX_COMMITTED;
-		else if (TransactionIdDidAbort(tuple->t_xmax))
+		else if (TransactionIdDidAbort(HeapTupleHeaderGetXmax(tuple)))
 		{
 			tuple->t_infomask |= HEAP_XMAX_INVALID;
 			return HEAPTUPLE_LIVE;
@@ -896,7 +901,8 @@
 	 * Deleter committed, but check special cases.
 	 */
 
-	if (TransactionIdEquals(tuple->t_xmin, tuple->t_xmax))
+	if (TransactionIdEquals(HeapTupleHeaderGetXmin(tuple),
+	                        HeapTupleHeaderGetXmax(tuple)))
 	{
 		/*
 		 * inserter also deleted it, so it was never visible to anyone
@@ -905,7 +911,7 @@
 		return HEAPTUPLE_DEAD;
 	}
 
-	if (!TransactionIdPrecedes(tuple->t_xmax, OldestXmin))
+	if (!TransactionIdPrecedes(HeapTupleHeaderGetXmax(tuple), OldestXmin))
 	{
 		/* deleting xact is too recent, tuple could still be visible */
 		return HEAPTUPLE_RECENTLY_DEAD;
diff -ur ../orig/src/include/access/htup.h src/include/access/htup.h
--- ../orig/src/include/access/htup.h	2002-05-27 23:52:42.000000000 +0200
+++ src/include/access/htup.h	2002-06-10 16:50:31.000000000 +0200
@@ -16,6 +16,7 @@
 
 #include "storage/bufpage.h"
 #include "storage/relfilenode.h"
+#include "access/transam.h"
 
 
 /*
@@ -84,6 +85,87 @@
 typedef HeapTupleHeaderData *HeapTupleHeader;
 
 /*
+ * information stored in t_infomask:
+ */
+#define HEAP_HASNULL			0x0001	/* has null attribute(s) */
+#define HEAP_HASVARLENA			0x0002	/* has variable length
+										 * attribute(s) */
+#define HEAP_HASEXTERNAL		0x0004	/* has external stored
+										 * attribute(s) */
+#define HEAP_HASCOMPRESSED		0x0008	/* has compressed stored
+										 * attribute(s) */
+#define HEAP_HASEXTENDED		0x000C	/* the two above combined */
+
+#define HEAP_XMAX_UNLOGGED		0x0080	/* to lock tuple for update */
+										/* without logging */
+#define HEAP_XMIN_COMMITTED		0x0100	/* t_xmin committed */
+#define HEAP_XMIN_INVALID		0x0200	/* t_xmin invalid/aborted */
+#define HEAP_XMAX_COMMITTED		0x0400	/* t_xmax committed */
+#define HEAP_XMAX_INVALID		0x0800	/* t_xmax invalid/aborted */
+#define HEAP_MARKED_FOR_UPDATE	0x1000	/* marked for UPDATE */
+#define HEAP_UPDATED			0x2000	/* this is UPDATEd version of row */
+#define HEAP_MOVED_OFF			0x4000	/* moved to another place by
+										 * vacuum */
+#define HEAP_MOVED_IN			0x8000	/* moved from another place by
+										 * vacuum */
+
+#define HEAP_XACT_MASK			0xFFF0	/* visibility-related bits */
+
+
+
+/* HeapTupleHeader accessor macros */
+
+#define HeapTupleHeaderGetXmin(tup) \
+	((tup)->t_xmin)
+
+#define HeapTupleHeaderGetXmax(tup) \
+	((tup)->t_xmax)
+
+/* no AssertMacro, because this is read as a system-defined attribute also */
+#define HeapTupleHeaderGetCmin(tup) \
+( \
+	(tup)->t_cmin \
+)
+
+#define HeapTupleHeaderGetCmax(tup) \
+	((tup)->t_cmax)
+
+#define HeapTupleHeaderGetXvac(tup) \
+( \
+	AssertMacro((tup)->t_infomask & (HEAP_MOVED_IN | HEAP_MOVED_OFF)), \
+	(TransactionId) (tup)->t_cmin \
+)
+
+
+#define HeapTupleHeaderSetXmin(tup, xid) \
+	(TransactionIdStore((xid), &(tup)->t_xmin))
+
+#define HeapTupleHeaderSetXminInvalid(tup) \
+	(StoreInvalidTransactionId(&(tup)->t_xmin))
+
+#define HeapTupleHeaderSetXmax(tup, xid) \
+	(TransactionIdStore((xid), &(tup)->t_xmax))
+
+#define HeapTupleHeaderSetXmaxInvalid(tup) \
+	(StoreInvalidTransactionId(&(tup)->t_xmax))
+
+#define HeapTupleHeaderSetCmin(tup, cid) \
+( \
+	AssertMacro(!((tup)->t_infomask & (HEAP_MOVED_IN | HEAP_MOVED_OFF))), \
+	(tup)->t_cmin = (cid) \
+)
+
+#define HeapTupleHeaderSetCmax(tup, cid) \
+	((tup)->t_cmax = (cid))
+
+#define HeapTupleHeaderSetXvac(tup, xid) \
+( \
+	AssertMacro((tup)->t_infomask & (HEAP_MOVED_IN | HEAP_MOVED_OFF)), \
+	TransactionIdStore((xid), (TransactionId *) &((tup)->t_cmin)) \
+)
+
+
+/*
  * XLOG allows to store some information in high 4 bits of log
  * record xl_info field
  */
@@ -250,33 +332,6 @@
  */
 #define HeapTupleIsValid(tuple) PointerIsValid(tuple)
 
-/*
- * information stored in t_infomask:
- */
-#define HEAP_HASNULL			0x0001	/* has null attribute(s) */
-#define HEAP_HASVARLENA			0x0002	/* has variable length
-										 * attribute(s) */
-#define HEAP_HASEXTERNAL		0x0004	/* has external stored
-										 * attribute(s) */
-#define HEAP_HASCOMPRESSED		0x0008	/* has compressed stored
-										 * attribute(s) */
-#define HEAP_HASEXTENDED		0x000C	/* the two above combined */
-
-#define HEAP_XMAX_UNLOGGED		0x0080	/* to lock tuple for update
-										 * without logging */
-#define HEAP_XMIN_COMMITTED		0x0100	/* t_xmin committed */
-#define HEAP_XMIN_INVALID		0x0200	/* t_xmin invalid/aborted */
-#define HEAP_XMAX_COMMITTED		0x0400	/* t_xmax committed */
-#define HEAP_XMAX_INVALID		0x0800	/* t_xmax invalid/aborted */
-#define HEAP_MARKED_FOR_UPDATE	0x1000	/* marked for UPDATE */
-#define HEAP_UPDATED			0x2000	/* this is UPDATEd version of row */
-#define HEAP_MOVED_OFF			0x4000	/* moved to another place by
-										 * vacuum */
-#define HEAP_MOVED_IN			0x8000	/* moved from another place by
-										 * vacuum */
-
-#define HEAP_XACT_MASK			0xFFF0	/* visibility-related bits */
-
 #define HeapTupleNoNulls(tuple) \
 		(!(((HeapTuple) (tuple))->t_data->t_infomask & HEAP_HASNULL))
 
diff -ur ../orig/src/pl/plperl/plperl.c src/pl/plperl/plperl.c
--- ../orig/src/pl/plperl/plperl.c	2002-05-05 02:03:29.000000000 +0200
+++ src/pl/plperl/plperl.c	2002-06-10 15:40:46.000000000 +0200
@@ -552,8 +552,8 @@
 		 * This is needed because CREATE OR REPLACE FUNCTION can modify the
 		 * function's pg_proc entry without changing its OID.
 		 ************************************************************/
-		uptodate = (prodesc->fn_xmin == procTup->t_data->t_xmin &&
-					prodesc->fn_cmin == procTup->t_data->t_cmin);
+		uptodate = (prodesc->fn_xmin == HeapTupleHeaderGetXmin(procTup->t_data) &&
+					prodesc->fn_cmin == HeapTupleHeaderGetCmin(procTup->t_data));
 
 		if (!uptodate)
 		{
@@ -586,8 +586,8 @@
 			elog(ERROR, "plperl: out of memory");
 		MemSet(prodesc, 0, sizeof(plperl_proc_desc));
 		prodesc->proname = strdup(internal_proname);
-		prodesc->fn_xmin = procTup->t_data->t_xmin;
-		prodesc->fn_cmin = procTup->t_data->t_cmin;
+		prodesc->fn_xmin = HeapTupleHeaderGetXmin(procTup->t_data);
+		prodesc->fn_cmin = HeapTupleHeaderGetCmin(procTup->t_data);
 
 		/************************************************************
 		 * Lookup the pg_language tuple by Oid
diff -ur ../orig/src/pl/plpgsql/src/pl_comp.c src/pl/plpgsql/src/pl_comp.c
--- ../orig/src/pl/plpgsql/src/pl_comp.c	2002-05-03 02:32:18.000000000 +0200
+++ src/pl/plpgsql/src/pl_comp.c	2002-06-10 15:40:46.000000000 +0200
@@ -188,8 +188,8 @@
 
 	function->fn_name = strdup(NameStr(procStruct->proname));
 	function->fn_oid = fn_oid;
-	function->fn_xmin = procTup->t_data->t_xmin;
-	function->fn_cmin = procTup->t_data->t_cmin;
+	function->fn_xmin = HeapTupleHeaderGetXmin(procTup->t_data);
+	function->fn_cmin = HeapTupleHeaderGetCmin(procTup->t_data);
 	function->fn_functype = functype;
 
 	switch (functype)
diff -ur ../orig/src/pl/plpgsql/src/pl_handler.c src/pl/plpgsql/src/pl_handler.c
--- ../orig/src/pl/plpgsql/src/pl_handler.c	2001-10-25 07:50:20.000000000 +0200
+++ src/pl/plpgsql/src/pl_handler.c	2002-06-10 15:40:46.000000000 +0200
@@ -167,8 +167,8 @@
 		elog(ERROR, "plpgsql: cache lookup for proc %u failed",
 			 func->fn_oid);
 
-	result = (func->fn_xmin == procTup->t_data->t_xmin &&
-			  func->fn_cmin == procTup->t_data->t_cmin);
+	result = (func->fn_xmin == HeapTupleHeaderGetXmin(procTup->t_data) &&
+			  func->fn_cmin == HeapTupleHeaderGetCmin(procTup->t_data));
 
 	ReleaseSysCache(procTup);
 
diff -ur ../orig/src/pl/plpython/plpython.c src/pl/plpython/plpython.c
--- ../orig/src/pl/plpython/plpython.c	2002-03-29 21:06:27.000000000 +0100
+++ src/pl/plpython/plpython.c	2002-06-10 15:40:46.000000000 +0200
@@ -1030,8 +1030,8 @@
 		if (proc->me != plproc)
 			elog(FATAL, "plpython: Aiieee, proc->me != plproc");
 		/* did we find an up-to-date cache entry? */
-		if (proc->fn_xmin != procTup->t_data->t_xmin ||
-			proc->fn_cmin != procTup->t_data->t_cmin)
+		if (proc->fn_xmin != HeapTupleHeaderGetXmin(procTup->t_data) ||
+			proc->fn_cmin != HeapTupleHeaderGetCmin(procTup->t_data))
 		{
 			Py_DECREF(plproc);
 			proc = NULL;
@@ -1075,8 +1075,8 @@
 	proc = PLy_malloc(sizeof(PLyProcedure));
 	proc->proname = PLy_malloc(strlen(procName) + 1);
 	strcpy(proc->proname, procName);
-	proc->fn_xmin = procTup->t_data->t_xmin;
-	proc->fn_cmin = procTup->t_data->t_cmin;
+	proc->fn_xmin = HeapTupleHeaderGetXmin(procTup->t_data);
+	proc->fn_cmin = HeapTupleHeaderGetCmin(procTup->t_data);
 	PLy_typeinfo_init(&proc->result);
 	for (i = 0; i < FUNC_MAX_ARGS; i++)
 		PLy_typeinfo_init(&proc->args[i]);
diff -ur ../orig/src/pl/tcl/pltcl.c src/pl/tcl/pltcl.c
--- ../orig/src/pl/tcl/pltcl.c	2002-05-27 16:29:42.000000000 +0200
+++ src/pl/tcl/pltcl.c	2002-06-10 15:40:46.000000000 +0200
@@ -987,8 +987,8 @@
 
 		prodesc = (pltcl_proc_desc *) Tcl_GetHashValue(hashent);
 
-		uptodate = (prodesc->fn_xmin == procTup->t_data->t_xmin &&
-					prodesc->fn_cmin == procTup->t_data->t_cmin);
+		uptodate = (prodesc->fn_xmin == HeapTupleHeaderGetXmin(procTup->t_data) &&
+					prodesc->fn_cmin == HeapTupleHeaderGetCmin(procTup->t_data));
 
 		if (!uptodate)
 		{
@@ -1025,8 +1025,8 @@
 			elog(ERROR, "pltcl: out of memory");
 		MemSet(prodesc, 0, sizeof(pltcl_proc_desc));
 		prodesc->proname = strdup(internal_proname);
-		prodesc->fn_xmin = procTup->t_data->t_xmin;
-		prodesc->fn_cmin = procTup->t_data->t_cmin;
+		prodesc->fn_xmin = HeapTupleHeaderGetXmin(procTup->t_data);
+		prodesc->fn_cmin = HeapTupleHeaderGetCmin(procTup->t_data);
 
 		/************************************************************
 		 * Lookup the pg_language tuple by Oid
