1010#include "pg_rman.h"
1111
1212static void show_backup_list (FILE * out ,parray * backup_list ,bool show_all );
13- static void show_timeline_backup_list (FILE * out ,parray * backup_list ,bool show_all );
1413static void show_backup_detail (FILE * out ,pgBackup * backup );
1514
1615/*
@@ -19,7 +18,7 @@ static void show_backup_detail(FILE *out, pgBackup *backup);
1918 * backup indicated by id.
2019 */
2120int
22- do_show (pgBackupRange * range ,bool show_timeline , bool show_all )
21+ do_show (pgBackupRange * range ,bool show_all )
2322{
2423if (pgBackupRangeIsSingle (range ))
2524{
@@ -49,10 +48,7 @@ do_show(pgBackupRange *range, bool show_timeline, bool show_all)
4948elog (ERROR_SYSTEM ,_ ("can't process any more." ));
5049}
5150
52- if (!show_timeline )
53- show_backup_list (stdout ,backup_list ,show_all );
54- else
55- show_timeline_backup_list (stdout ,backup_list ,show_all );
51+ show_backup_list (stdout ,backup_list ,show_all );
5652
5753/* cleanup */
5854parray_walk (backup_list ,pgBackupFree );
@@ -165,13 +161,15 @@ show_backup_list(FILE *out, parray *backup_list, bool show_all)
165161int i ;
166162
167163/* show header */
168- fputs ("============================================================================\n" ,out );
169- fputs ("Start Time Total Data WAL Log Backup Status \n" ,out );
170- fputs ("============================================================================\n" ,out );
164+ fputs ("=========================================================================================================== \n" ,out );
165+ fputs ("StartMode Current TLI Parent TLI Time Total Data WAL Log Backup Status \n" ,out );
166+ fputs ("=========================================================================================================== \n" ,out );
171167
172168for (i = 0 ;i < parray_num (backup_list );i ++ )
173169{
174170pgBackup * backup ;
171+ const char * modes []= {"" ,"ARCH" ,"INCR" ,"FULL" };
172+ TimeLineID parent_tli ;
175173char timestamp [20 ];
176174char duration [20 ]= "----" ;
177175char total_data_bytes_str [10 ]= "----" ;
@@ -206,45 +204,13 @@ show_backup_list(FILE *out, parray *backup_list, bool show_all)
206204pretty_size (backup -> write_bytes ,write_bytes_str ,
207205lengthof (write_bytes_str ));
208206
209- fprintf (out ,"%-19s %5s %6s %6s %6s %6s %6s %s\n" ,
210- timestamp ,duration ,
211- total_data_bytes_str ,read_data_bytes_str ,read_arclog_bytes_str ,
212- read_srvlog_bytes_str ,write_bytes_str ,status2str (backup -> status ));
213- }
214- }
215-
216- static void
217- show_timeline_backup_list (FILE * out ,parray * backup_list ,bool show_all )
218- {
219- int i ;
220-
221- /* show header */
222- fputs ("============================================================\n" ,out );
223- fputs ("Start Mode Current TLI Parent TLI Status \n" ,out );
224- fputs ("============================================================\n" ,out );
225-
226- for (i = 0 ;i < parray_num (backup_list );i ++ )
227- {
228- static const char * modes []= {"" ,"ARCH" ,"INCR" ,"FULL" };
229-
230- pgBackup * backup ;
231- char timestamp [20 ];
232- TimeLineID parent_tli ;
233-
234- backup = parray_get (backup_list ,i );
235-
236- /* skip deleted backup and serverlog backup */
237- if ((backup -> status == BACKUP_STATUS_DELETED || !HAVE_ARCLOG (backup ))&&
238- !show_all )
239- continue ;
240-
241- time2iso (timestamp ,lengthof (timestamp ),backup -> start_time );
242-
207+ /* Get parent timeline before printing */
243208parent_tli = get_parent_tli (backup -> tli );
244209
245- fprintf (out ,"%-19s %-4s %10d %10d %s\n" ,
246- timestamp ,modes [backup -> backup_mode ],backup -> tli ,parent_tli ,
247- status2str (backup -> status ));
210+ fprintf (out ,"%-19s %-4s %10d %10d %5s %6s %6s %6s %6s %6s %s\n" ,
211+ timestamp ,modes [backup -> backup_mode ],backup -> tli ,parent_tli ,duration ,
212+ total_data_bytes_str ,read_data_bytes_str ,read_arclog_bytes_str ,
213+ read_srvlog_bytes_str ,write_bytes_str ,status2str (backup -> status ));
248214}
249215}
250216