aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/replication/basebackup.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c
index 12b5e24cac5..ba8d173357e 100644
--- a/src/backend/replication/basebackup.c
+++ b/src/backend/replication/basebackup.c
@@ -304,6 +304,14 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir)
qsort(walFiles, nWalFiles, sizeof(char *), compareWalFileNames);
/*
+ * There must be at least one xlog file in the pg_xlog directory,
+ * since we are doing backup-including-xlog.
+ */
+ if (nWalFiles < 1)
+ ereport(ERROR,
+ (errmsg("could not find any WAL files")));
+
+ /*
* Sanity check: the first and last segment should cover startptr and
* endptr, with no gaps in between.
*/