Chris Browne cbbrowne at lists.slony.info
Fri May 1 08:18:24 PDT 2009
Update of /home/cvsd/slony1/slony1-engine/src/slon
In directory main.slony.info:/tmp/cvs-serv12311

Modified Files:
      Tag: REL_2_0_STABLE
	cleanup_thread.c 
Log Message:
Fix problem with interpretation of return code for VACUUM/ANALYZE

Per Melvin Davidson


Index: cleanup_thread.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/cleanup_thread.c,v
retrieving revision 1.45
retrieving revision 1.45.2.1
diff -C2 -d -r1.45 -r1.45.2.1
*** cleanup_thread.c	28 May 2008 19:09:37 -0000	1.45
--- cleanup_thread.c	1 May 2009 15:18:22 -0000	1.45.2.1
***************
*** 190,193 ****
--- 190,194 ----
  				char	   *tab_nspname = PQgetvalue(res, t, 0);
  				char	   *tab_relname = PQgetvalue(res, t, 1);
+ 				ExecStatusType vrc;
  
  				slon_log(SLON_DEBUG1, "cleanupThread: %s analyze \"%s\".%s;\n",
***************
*** 197,209 ****
  							 vacuum_action, tab_nspname, tab_relname);
  				res2 = PQexec(dbconn, dstring_data(&query_pertbl));
! 				if (PQresultStatus(res) != PGRES_COMMAND_OK)	/* query error */
  				{
  					slon_log(SLON_ERROR,
! 							 "cleanupThread: \"%s\" - %s",
! 					dstring_data(&query_pertbl), PQresultErrorMessage(res2));
  
  					/*
  					 * slon_retry(); break;
  					 */
  				}
  				PQclear(res2);
--- 198,218 ----
  							 vacuum_action, tab_nspname, tab_relname);
  				res2 = PQexec(dbconn, dstring_data(&query_pertbl));
! 				vrc = PQresultStatus(res);
! 				if (vrc == PGRES_FATAL_ERROR)
  				{
  					slon_log(SLON_ERROR,
! 							 "cleanupThread: \"%s\" - %s\n",
! 							 dstring_data(&query_pertbl), PQresultErrorMessage(res2));
  
  					/*
  					 * slon_retry(); break;
  					 */
+ 				} else {
+ 					if (vrc == PGRES_NONFATAL_ERROR) {
+ 						slon_log(SLON_WARN,
+ 								 "cleanupThread: \"%s\" - %s\n",
+ 								 dstring_data(&query_pertbl), PQresultErrorMessage(res2));
+ 						
+ 					}
  				}
  				PQclear(res2);



More information about the Slony1-commit mailing list