Please find attached a patch which provides for logging in the event that -k 
is unable to clean up an old WAL file.  Also make the failed to remove file 
error message consistant for the trigger file.



-- 
Darcy Buskermolen
Command Prompt, Inc.
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
PostgreSQL solutions since 1997
http://www.commandprompt.com/
? pg_standby.c.patch
Index: pg_standby.c
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/pg_standby/pg_standby.c,v
retrieving revision 1.2
diff -u -c -r1.2 pg_standby.c
*** pg_standby.c	10 Feb 2007 19:52:45 -0000	1.2
--- pg_standby.c	20 Feb 2007 19:58:04 -0000
***************
*** 264,273 ****
  #else
  					snprintf(WALFilePath, MAXPGPATH, "%s/%s", archiveLocation, xlde->d_name);
  #endif
- 					rc = unlink(WALFilePath);
  
  					if (debug)
! 					   	fprintf(stderr, "\npg_standby: removed \"%s\"\n", WALFilePath);
  				}
  			}
  		}
--- 264,278 ----
  #else
  					snprintf(WALFilePath, MAXPGPATH, "%s/%s", archiveLocation, xlde->d_name);
  #endif
  
  					if (debug)
! 					   	fprintf(stderr, "\npg_standby: removing \"%s\"\n", WALFilePath);
! 
! 					rc = unlink(WALFilePath);
! 					if (rc !=0 )
! 						fprintf(stderr, "\npg_standby: ERROR failed to remove \"%s\" because %s\n", WALFilePath,  strerror(errno));
! 
! 
  				}
  			}
  		}
***************
*** 315,321 ****
  		rc = unlink(triggerPath);
  		if (rc != 0)
  		{
! 			fprintf(stderr, "\n ERROR: unable to remove \"%s\", rc=%d", triggerPath, rc);
  			fflush(stderr);
  			exit(rc);
  		}
--- 320,326 ----
  		rc = unlink(triggerPath);
  		if (rc != 0)
  		{
! 			fprintf(stderr, "\n ERROR: unable to remove \"%s\", because %s", triggerPath, strerror(errno));
  			fflush(stderr);
  			exit(rc);
  		}
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to