Index: src/backend/access/transam/xlog.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/access/transam/xlog.c,v
retrieving revision 1.335
diff -c -r1.335 xlog.c
*** src/backend/access/transam/xlog.c	7 Apr 2009 00:31:26 -0000	1.335
--- src/backend/access/transam/xlog.c	8 Apr 2009 13:18:40 -0000
***************
*** 5950,5956 ****
--- 5950,5965 ----
  	if (RecoveryInProgress())
  		CreateRestartPoint(CHECKPOINT_IS_SHUTDOWN | CHECKPOINT_IMMEDIATE);
  	else
+ 	{
  		CreateCheckPoint(CHECKPOINT_IS_SHUTDOWN | CHECKPOINT_IMMEDIATE);
+ 		/*
+ 		 * if archiving is active and an archive command is set, we need to
+ 		 * rotate the last XLog file containing useful information so that
+ 		 * the archive command is also executed for it
+ 		 */
+ 		if(XLogArchivingActive() && XLogArchiveCommandSet())
+ 			RequestXLogSwitch();
+ 	}
  	ShutdownCLOG();
  	ShutdownSUBTRANS();
  	ShutdownMultiXact();
