@@ -226,15 +226,18 @@ show_backup_list(FILE *out, parray *backup_list)
226
226
227
227
/* if you add new fields here, fix the header */
228
228
/* show header */
229
- fputs ("==================================================================================================================================\n" , out );
230
- fputs (" Instance ID Recovery time Mode WAL Current/Parent TLI Time Data Start LSN Stop LSN Status\n" , out );
231
- fputs ("==================================================================================================================================\n" , out );
229
+ fputs ("============================================================================================================================================ \n" , out );
230
+ fputs (" Instance Version ID Recovery time Mode WAL Current/Parent TLI Time Data Start LSN Stop LSN Status \n" , out );
231
+ fputs ("============================================================================================================================================ \n" , out );
232
232
233
233
for (i = 0 ; i < parray_num (backup_list ); i ++ )
234
234
{
235
235
pgBackup * backup = parray_get (backup_list , i );
236
236
TimeLineID parent_tli ;
237
+ FILE * fp ;
237
238
char * backup_id ;
239
+ char pg_version_path [MAXPGPATH ];
240
+ char pg_version [100 ] = "---" ;
238
241
char timestamp [100 ] = "----" ;
239
242
char duration [20 ] = "----" ;
240
243
char data_bytes_str [10 ] = "----" ;
@@ -257,8 +260,27 @@ show_backup_list(FILE *out, parray *backup_list)
257
260
parent_tli = get_parent_tli (backup -> tli );
258
261
backup_id = base36enc (backup -> start_time );
259
262
260
- fprintf (out , " %-11s %-6s %-19s %-6s %-7s %3d / %-3d %5s %6s %2X/%-8X %2X/%-8X %-8s\n" ,
261
- instance_name , backup_id ,
263
+ /* Read PG_VERSION file to show backup version */
264
+ pgBackupGetPath2 (backup , pg_version_path , lengthof (pg_version_path ),
265
+ DATABASE_DIR , "PG_VERSION" );
266
+ fp = pgut_fopen (pg_version_path , "rt" , true);
267
+ if (fp )
268
+ {
269
+ if (fgets (pg_version , lengthof (pg_version ), fp ))
270
+ {
271
+ int len = strlen (pg_version );
272
+
273
+ /* Remove trailing new line */
274
+ if (len > 0 && pg_version [len - 1 ] == '\n' )
275
+ pg_version [len - 1 ] = '\0' ;
276
+ }
277
+ fclose (fp );
278
+ }
279
+
280
+ fprintf (out , " %-11s %-8s %-6s %-19s %-6s %-7s %3d / %-3d %5s %6s %2X/%-8X %2X/%-8X %-8s\n" ,
281
+ instance_name ,
282
+ pg_version ,
283
+ backup_id ,
262
284
timestamp ,
263
285
pgBackupGetBackupMode (backup ),
264
286
backup -> stream ? "STREAM" : "ARCHIVE" ,
0 commit comments