@@ -160,7 +160,7 @@ do_restore_or_validate(time_t target_backup_id, pgRecoveryTarget *rt,
160160if (!satisfy_recovery_target (current_backup ,rt ))
161161{
162162if (target_backup_id != INVALID_BACKUP_ID )
163- elog (ERROR ,"target backup %s does not satisfy restore options" ,
163+ elog (ERROR ,"Requested backup %s does not satisfy restore options" ,
164164base36enc (target_backup_id ));
165165else
166166/* Try to find another backup that satisfies target options */
@@ -175,8 +175,16 @@ do_restore_or_validate(time_t target_backup_id, pgRecoveryTarget *rt,
175175}
176176}
177177
178+ /* TODO: Show latest possible target */
178179if (dest_backup == NULL )
179- elog (ERROR ,"Backup satisfying target options is not found." );
180+ {
181+ /* Failed to find target backup */
182+ if (target_backup_id )
183+ elog (ERROR ,"Requested backup %s is not found." ,base36enc (target_backup_id ));
184+ else
185+ elog (ERROR ,"Backup satisfying target options is not found." );
186+ /* TODO: check if user asked PITR or just restore of latest backup */
187+ }
180188
181189/* If we already found dest_backup, look for full backup. */
182190if (dest_backup -> backup_mode == BACKUP_MODE_FULL )
@@ -954,6 +962,7 @@ read_timeline_history(TimeLineID targetTLI)
954962return result ;
955963}
956964
965+ /* TODO: do not ignore timelines. What if requested target located in different timeline? */
957966bool
958967satisfy_recovery_target (const pgBackup * backup ,const pgRecoveryTarget * rt )
959968{
@@ -969,6 +978,7 @@ satisfy_recovery_target(const pgBackup *backup, const pgRecoveryTarget *rt)
969978return true;
970979}
971980
981+ /* TODO description */
972982bool
973983satisfy_timeline (const parray * timelines ,const pgBackup * backup )
974984{