src/backend/utils/adt/xid8funcs.c
static FullTransactionId
widen_snapshot_xid(TransactionId xid, FullTransactionId next_fxid)
{
	TransactionId next_xid = XidFromFullTransactionId(next_fxid);
	uint32		epoch = EpochFromFullTransactionId(next_fxid);

	/* Special transaction ID. */
	if (!TransactionIdIsNormal(xid))
		return FullTransactionIdFromEpochAndXid(0, xid);

	/*
	 * The 64 bit result must be <= next_fxid, since next_fxid hadn't been
	 * issued yet when the snapshot was created.  Every TransactionId in the
	 * snapshot must therefore be from the same epoch as next_fxid, or the
	 * epoch before.  We know this because next_fxid is never allow to get
	 * more than one epoch ahead of the TransactionIds in any snapshot.
	 */
	if (xid > next_xid)
		epoch--;

	return FullTransactionIdFromEpochAndXid(epoch, xid);
}
/*
 * Convert a TransactionId obtained from a snapshot held by the caller to a
 * FullTransactionId.  Use next_fxid as a reference FullTransactionId, so that
 * we can compute the high order bits.  It must have been obtained by the
 * caller with ReadNextFullTransactionId() after the snapshot was created.
 */
Convert a TransactionId obtained from a snapshot held by the caller to a
FullTransactionId.  Use next_fxid as a reference FullTransactionId, so that
we can compute the high order bits.  It must have been obtained by the
caller with ReadNextFullTransactionId() after the snapshot was created.
Convert a TransactionId obtained from a snapshot held by the caller to a FullTransactionId . Use next_fxid as a reference FullTransactionId so that we can compute the high order bits . It must have been obtained by the caller with ReadNextFullTransactionId () after the snapshot was created .
static FullTransactionId
widen_snapshot_xid(TransactionId xid, FullTransactionId next_fxid)
{
	TransactionId next_xid = XidFromFullTransactionId(next_fxid);
	uint32		epoch = EpochFromFullTransactionId(next_fxid);
	if (!TransactionIdIsNormal(xid))
		return FullTransactionIdFromEpochAndXid(0, xid);
	if (xid > next_xid)
		epoch--;
	return FullTransactionIdFromEpochAndXid(epoch, xid);
}
static FullTransactionId widen_snapshot_xid ( TransactionId xid , FullTransactionId next_fxid ) { TransactionId next_xid = XidFromFullTransactionId ( next_fxid ) ; uint32 epoch = EpochFromFullTransactionId ( next_fxid ) ; if ( ! TransactionIdIsNormal ( xid ) ) return FullTransactionIdFromEpochAndXid ( 0 , xid ) ; if ( xid > next_xid ) epoch -- ; return FullTransactionIdFromEpochAndXid ( epoch , xid ) ; }
Convert a TransactionId obtained from a snapshot held by the caller to a
 FullTransactionId.
Convert a TransactionId obtained from a snapshot held by the caller to a FullTransactionId .
/* Special transaction ID. */ /*
	 * The 64 bit result must be <= next_fxid, since next_fxid hadn't been
	 * issued yet when the snapshot was created.  Every TransactionId in the
	 * snapshot must therefore be from the same epoch as next_fxid, or the
	 * epoch before.  We know this because next_fxid is never allow to get
	 * more than one epoch ahead of the TransactionIds in any snapshot.
	 */