@@ -294,6 +294,12 @@ pgBackupWriteResultSection(FILE *out, pgBackup *backup)
294
294
fprintf (out , "STREAM=%u\n" , backup -> stream );
295
295
296
296
fprintf (out , "STATUS=%s\n" , status2str (backup -> status ));
297
+ if (backup -> parent_backup != 0 )
298
+ {
299
+ char * parent_backup = base36enc (backup -> parent_backup );
300
+ fprintf (out , "PARENT_BACKUP='%s'\n" , parent_backup );
301
+ free (parent_backup );
302
+ }
297
303
}
298
304
299
305
/* create backup.ini */
@@ -331,6 +337,7 @@ catalog_read_ini(const char *path)
331
337
char * start_lsn = NULL ;
332
338
char * stop_lsn = NULL ;
333
339
char * status = NULL ;
340
+ char * parent_backup = NULL ;
334
341
int i ;
335
342
336
343
pgut_option options [] =
@@ -349,6 +356,7 @@ catalog_read_ini(const char *path)
349
356
{'u' , 0 , "checksum_version" , NULL , SOURCE_ENV },
350
357
{'u' , 0 , "stream" , NULL , SOURCE_ENV },
351
358
{'s' , 0 , "status" , NULL , SOURCE_ENV },
359
+ {'s' , 0 , "parent_backup" , NULL , SOURCE_ENV },
352
360
{0 }
353
361
};
354
362
@@ -373,6 +381,7 @@ catalog_read_ini(const char *path)
373
381
options [i ++ ].var = & backup -> checksum_version ;
374
382
options [i ++ ].var = & backup -> stream ;
375
383
options [i ++ ].var = & status ;
384
+ options [i ++ ].var = & parent_backup ;
376
385
Assert (i == lengthof (options ) - 1 );
377
386
378
387
pgut_readopt (path , options , ERROR );
@@ -428,6 +437,12 @@ catalog_read_ini(const char *path)
428
437
free (status );
429
438
}
430
439
440
+ if (parent_backup )
441
+ {
442
+ backup -> parent_backup = base36dec (parent_backup );
443
+ free (parent_backup );
444
+ }
445
+
431
446
return backup ;
432
447
}
433
448
@@ -514,4 +529,5 @@ catalog_init_config(pgBackup *backup)
514
529
backup -> recovery_time = (time_t ) 0 ;
515
530
backup -> data_bytes = BYTES_INVALID ;
516
531
backup -> stream = false;
532
+ backup -> parent_backup = 0 ;
517
533
}
0 commit comments