Skip to content

Commit 94a8a24

Browse files
committed
minor bugfix: check that PGDATA is not empty, following #48
1 parent ec2aa7f commit 94a8a24

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backup.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,14 @@ do_backup_instance(void)
634634
dir_list_file(backup_files_list, instance_config.pgdata,
635635
true, true, false);
636636

637+
/* Sanity check for backup_files_list, thank you, Windows:
638+
* https://github.com/postgrespro/pg_probackup/issues/48
639+
*/
640+
641+
if (parray_num(backup_files_list) == 0)
642+
elog(ERROR, "PGDATA is empty. Either it was concrurrently deleted or "
643+
"pg_probackup do not possess sufficient permissions to list PGDATA content");
644+
637645
/*
638646
* Sort pathname ascending. It is necessary to create intermediate
639647
* directories sequentially.

0 commit comments

Comments
 (0)