10
10
#include "pg_rman.h"
11
11
12
12
static 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 );
14
13
static void show_backup_detail (FILE * out ,pgBackup * backup );
15
14
16
15
/*
@@ -19,7 +18,7 @@ static void show_backup_detail(FILE *out, pgBackup *backup);
19
18
* backup indicated by id.
20
19
*/
21
20
int
22
- do_show (pgBackupRange * range ,bool show_timeline , bool show_all )
21
+ do_show (pgBackupRange * range ,bool show_all )
23
22
{
24
23
if (pgBackupRangeIsSingle (range ))
25
24
{
@@ -49,10 +48,7 @@ do_show(pgBackupRange *range, bool show_timeline, bool show_all)
49
48
elog (ERROR_SYSTEM ,_ ("can't process any more." ));
50
49
}
51
50
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 );
56
52
57
53
/* cleanup */
58
54
parray_walk (backup_list ,pgBackupFree );
@@ -165,13 +161,15 @@ show_backup_list(FILE *out, parray *backup_list, bool show_all)
165
161
int i ;
166
162
167
163
/* 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 );
171
167
172
168
for (i = 0 ;i < parray_num (backup_list );i ++ )
173
169
{
174
170
pgBackup * backup ;
171
+ const char * modes []= {"" ,"ARCH" ,"INCR" ,"FULL" };
172
+ TimeLineID parent_tli ;
175
173
char timestamp [20 ];
176
174
char duration [20 ]= "----" ;
177
175
char total_data_bytes_str [10 ]= "----" ;
@@ -206,45 +204,13 @@ show_backup_list(FILE *out, parray *backup_list, bool show_all)
206
204
pretty_size (backup -> write_bytes ,write_bytes_str ,
207
205
lengthof (write_bytes_str ));
208
206
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 */
243
208
parent_tli = get_parent_tli (backup -> tli );
244
209
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 ));
248
214
}
249
215
}
250
216