*** a/src/backend/storage/lmgr/predicate.c
--- b/src/backend/storage/lmgr/predicate.c
***************
*** 3771,3777 **** CheckTargetForConflictsIn(PREDICATELOCKTARGETTAG *targettag)
  			LWLockRelease(SerializableXactHashLock);
  			LWLockAcquire(SerializableXactHashLock, LW_EXCLUSIVE);
  
! 			FlagRWConflict(sxact, (SERIALIZABLEXACT *) MySerializableXact);
  
  			LWLockRelease(SerializableXactHashLock);
  			LWLockAcquire(SerializableXactHashLock, LW_SHARED);
--- 3771,3789 ----
  			LWLockRelease(SerializableXactHashLock);
  			LWLockAcquire(SerializableXactHashLock, LW_EXCLUSIVE);
  
! 			/*
! 			 * Re-check after getting exclusive lock because the other
! 			 * transaction may have flagged a conflict.
! 			 */
! 			if (!SxactIsRolledBack(sxact)
! 				&& (!SxactIsCommitted(sxact)
! 					|| TransactionIdPrecedes(GetTransactionSnapshot()->xmin,
! 											 sxact->finishedBefore))
! 				&& !RWConflictExists(sxact,
! 									 (SERIALIZABLEXACT *) MySerializableXact))
! 			{
! 				FlagRWConflict(sxact, (SERIALIZABLEXACT *) MySerializableXact);
! 			}
  
  			LWLockRelease(SerializableXactHashLock);
  			LWLockAcquire(SerializableXactHashLock, LW_SHARED);
