diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c
new file mode 100644
index 2429889..abc2e28
*** a/src/backend/commands/vacuumlazy.c
--- b/src/backend/commands/vacuumlazy.c
*************** lazy_scan_heap(Relation onerel, LVRelSta
*** 490,495 ****
--- 490,501 ----
  	 * relfrozenxid, so we only want to do it if we can skip a goodly number
  	 * of pages.
  	 *
+ 	 * We never skip the last page.  This avoids having every vacuum take the 
+ 	 * access exclusive lock on the table to do a truncation which is doomed
+ 	 * to fail in cases where a table has a stable series of all visible pages
+ 	 * at the end.  This is worth avoiding because the access exclusive lock 
+ 	 * must be replayed on any hot standby, where it can be disruptive.
+ 	 *
  	 * Before entering the main loop, establish the invariant that
  	 * next_not_all_visible_block is the next block number >= blkno that's not
  	 * all-visible according to the visibility map, or nblocks if there's no
*************** lazy_scan_heap(Relation onerel, LVRelSta
*** 567,573 ****
  		else
  		{
  			/* Current block is all-visible */
! 			if (skipping_all_visible_blocks && !scan_all)
  				continue;
  			all_visible_according_to_vm = true;
  		}
--- 573,579 ----
  		else
  		{
  			/* Current block is all-visible */
! 			if (skipping_all_visible_blocks && !scan_all && blkno != nblocks-1)
  				continue;
  			all_visible_according_to_vm = true;
  		}
