@@ -161,6 +161,8 @@ do_restore(time_t backup_id,
161
161
162
162
print_backup_lsn (base_backup );
163
163
164
+ stream_wal = base_backup -> stream ;
165
+
164
166
/* restore base backup */
165
167
restore_database (base_backup );
166
168
@@ -181,6 +183,9 @@ do_restore(time_t backup_id,
181
183
if (backup -> backup_mode == BACKUP_MODE_FULL )
182
184
break ;
183
185
186
+ if (backup_id && backup -> start_time > backup_id )
187
+ break ;
188
+
184
189
/* use database backup only */
185
190
if (backup -> backup_mode != BACKUP_MODE_DIFF_PAGE &&
186
191
backup -> backup_mode != BACKUP_MODE_DIFF_PTRACK )
@@ -198,7 +203,7 @@ do_restore(time_t backup_id,
198
203
last_restored_index = i ;
199
204
}
200
205
201
- if (!stream_wal )
206
+ if (!stream_wal || target_time != NULL || target_xid != NULL )
202
207
for (i = last_restored_index ; i >= 0 ; i -- )
203
208
{
204
209
elog (LOG , "searching archived WAL..." );
@@ -209,7 +214,7 @@ do_restore(time_t backup_id,
209
214
}
210
215
211
216
/* create recovery.conf */
212
- if (!stream_wal )
217
+ if (!stream_wal || target_time != NULL || target_xid != NULL )
213
218
create_recovery_conf (target_time , target_xid , target_inclusive , target_tli );
214
219
215
220
/* release catalog lock */
0 commit comments