From 798c447be73a472459822d3cf54cb899fd5675ac Mon Sep 17 00:00:00 2001 From: Anastasia Date: Mon, 29 May 2017 12:45:56 +0300 Subject: [PATCH] fix skipping empty files in backup --- data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data.c b/data.c index 562e123d..83aa02a3 100644 --- a/data.c +++ b/data.c @@ -299,7 +299,7 @@ backup_data_file(const char *from_root, const char *to_root, * If we have pagemap then file can't be a zero size. * Otherwise, we will clear the last file. */ - if (n_blocks_read == n_blocks_skipped) + if (n_blocks_read != 0 && n_blocks_read == n_blocks_skipped) { if (remove(to_path) == -1) elog(ERROR, "cannot remove file \"%s\": %s", to_path,