Now that we have set archiver messages to DEBUG levels, there's no easy
way of seeing what file we are on.

Patch to set ps display for archiver enclosed, intended for 8.3

Before archive_command
postgres: archiver process   archiving 00000001000000000000000B

After archive_command
postgres: archiver process   archived 00000001000000000000000B

So the behaviour of the startup process and archiver are now
symmetrical, allowing it to be used for replication monitoring.

-- 
  Simon Riggs
  2ndQuadrant  http://www.2ndQuadrant.com
Index: src/backend/postmaster/pgarch.c
===================================================================
RCS file: /home/sriggs/pg/REPOSITORY/pgsql/src/backend/postmaster/pgarch.c,v
retrieving revision 1.34
diff -c -r1.34 pgarch.c
*** src/backend/postmaster/pgarch.c	12 Dec 2007 09:39:54 -0000	1.34
--- src/backend/postmaster/pgarch.c	12 Dec 2007 21:01:52 -0000
***************
*** 414,419 ****
--- 414,420 ----
  {
  	char		xlogarchcmd[MAXPGPATH];
  	char		pathname[MAXPGPATH];
+ 	char		activitymsg[MAXFNAMELEN + 16];
  	char	   *dp;
  	char	   *endp;
  	const char *sp;
***************
*** 471,476 ****
--- 472,482 ----
  	ereport(DEBUG3,
  			(errmsg_internal("executing archive command \"%s\"",
  							 xlogarchcmd)));
+ 
+ 	/* Report archive command execution in PS display */
+ 	snprintf(activitymsg, sizeof(activitymsg), "archiving %s", xlog);
+ 	set_ps_display(activitymsg, false);
+ 
  	rc = system(xlogarchcmd);
  	if (rc != 0)
  	{
***************
*** 519,524 ****
--- 525,533 ----
  	ereport(DEBUG1,
  			(errmsg("archived transaction log file \"%s\"", xlog)));
  
+ 	snprintf(activitymsg, sizeof(activitymsg), "archived %s", xlog);
+ 	set_ps_display(activitymsg, false);
+ 
  	return true;
  }
  
---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to