Fix a couple of problems pointed out by Fujii Masao in the 2008-Apr-05 patch
commitb5002a598d5877d81bbfe9c53c3d3796f22db4ae
authortgl <tgl>
Mon, 8 Sep 2008 16:42:15 +0000 (8 16:42 +0000)
committertgl <tgl>
Mon, 8 Sep 2008 16:42:15 +0000 (8 16:42 +0000)
treed83fbcf5cdf09fa562deefe08b48840118390889
parent7d7dcac539a751b2e96c749015d359af567e14b1
Fix a couple of problems pointed out by Fujii Masao in the 2008-Apr-05 patch
for pg_stop_backup.  First, it is possible that the history file name is not
alphabetically later than the last WAL file name, so we should explicitly
check that both have been archived.  Second, the previous coding would wait
forever if a checkpoint had managed to remove the WAL file before we look for
it.

Simon Riggs, plus some code cleanup by me.
src/backend/access/transam/xlog.c