Skip to content

Commit 8f4232d

Browse files
committed
add check
1 parent 27497d5 commit 8f4232d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/restore.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,11 @@ do_restore_or_validate(time_t target_backup_id, pgRecoveryTarget *rt,
203203
dest_backup = current_backup;
204204
dest_backup_index = i;
205205
}
206-
207206
}
208207

208+
if (dest_backup == NULL)
209+
elog(ERROR, "Backup satisfying target options is not found.");
210+
209211
/* If we already found dest_backup, look for full backup. */
210212
if (dest_backup)
211213
{
@@ -238,6 +240,9 @@ do_restore_or_validate(time_t target_backup_id, pgRecoveryTarget *rt,
238240
}
239241
}
240242

243+
if (base_full_backup == NULL)
244+
elog(ERROR, "Full backup satisfying target options is not found.");
245+
241246
/*
242247
* Ensure that directories provided in tablespace mapping are valid
243248
* i.e. empty or not exist.

0 commit comments

Comments
 (0)