Setting non-existing value in recovery-target-timeline option, pg_rman restore fails with error.
$ pg_rman -B /home/postgres/pg_data/backup/ -A /home/postgres/pg_data/archive/ restore --recovery-target-timeline 39
ERROR: no full backup found, can't restore.
Though restore failed, the restore destination, that is an original database cluster was erased by pg_rman.
This is because the check of existence of full backcup which can be used as base backup for specified timeline is done after deletion of restore destination.
I think this check should be done before deletion of restore destination.
Attached a patch created by Amit Langote.
I have committed.