When running pg_basebackup with -x to include all transaction log, the
server will still throw a warning about xlog archiving if it's not
enabled - that is completely irrelevant since pg_basebackup has
included it already (and if it was gone, the base backup step itself
will fail - actual error and not warning).

This patch moves the warning from do_pg_base_backup to pg_base_backup,
so it still shows when using the explicit function calls, but goes
away when using pg_basebackup.

Objections?

-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 66cc004..7d1a95e 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -8619,6 +8619,11 @@ pg_stop_backup(PG_FUNCTION_ARGS)
 
 	snprintf(stopxlogstr, sizeof(stopxlogstr), "%X/%X",
 			 stoppoint.xlogid, stoppoint.xrecoff);
+
+	if (!XLogArchivingActive())
+		ereport(NOTICE,
+				(errmsg("WAL archiving is not enabled; you must ensure that all required WAL segments are copied through other means to complete the backup")));
+
 	PG_RETURN_TEXT_P(cstring_to_text(stopxlogstr));
 }
 
@@ -8870,9 +8875,6 @@ do_pg_stop_backup(char *labelfile)
 		ereport(NOTICE,
 				(errmsg("pg_stop_backup complete, all required WAL segments have been archived")));
 	}
-	else
-		ereport(NOTICE,
-				(errmsg("WAL archiving is not enabled; you must ensure that all required WAL segments are copied through other means to complete the backup")));
 
 	/*
 	 * We're done.  As a convenience, return the ending WAL location.
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to