diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
new file mode 100644
index efc8e7c..244930f
*** a/src/backend/postmaster/autovacuum.c
--- b/src/backend/postmaster/autovacuum.c
*************** do_start_worker(void)
*** 1107,1114 ****
  	 */
  	recentXid = ReadNewTransactionId();
  	xidForceLimit = recentXid - autovacuum_freeze_max_age;
! 	/* ensure it's a "normal" XID, else TransactionIdPrecedes misbehaves */
! 	if (xidForceLimit < FirstNormalTransactionId)
  		xidForceLimit -= FirstNormalTransactionId;
  
  	/*
--- 1107,1120 ----
  	 */
  	recentXid = ReadNewTransactionId();
  	xidForceLimit = recentXid - autovacuum_freeze_max_age;
! 	/*
! 	 * Adjust for xids in the invalid range, less than FirstNormalTransactionId.
! 	 * We map the xids as though the invalid range did not exist.
! 	 * We cannot simplify the test below because of underflow
! 	 * issues with unsigned values.
! 	 */
! 	if (xidForceLimit < FirstNormalTransactionId || /* in invalid range? */
! 		recentXid < autovacuum_freeze_max_age) 		/* did we underflow? */
  		xidForceLimit -= FirstNormalTransactionId;
  
  	/*
