Skip to content

Commit 798c447

Browse files
committed
fix skipping empty files in backup
1 parent 035b639 commit 798c447

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ backup_data_file(const char *from_root, const char *to_root,
299299
* If we have pagemap then file can't be a zero size.
300300
* Otherwise, we will clear the last file.
301301
*/
302-
if (n_blocks_read == n_blocks_skipped)
302+
if (n_blocks_read != 0 && n_blocks_read == n_blocks_skipped)
303303
{
304304
if (remove(to_path) == -1)
305305
elog(ERROR, "cannot remove file \"%s\": %s", to_path,

0 commit comments

Comments
 (0)