@@ -40,6 +40,7 @@ boolfrom_replica = false;
40
40
static bool backup_logs = false;
41
41
bool progress = false;
42
42
bool delete_wal = false;
43
+ uint64 system_identifier = 0 ;
43
44
44
45
/* restore configuration */
45
46
static char * target_time ;
@@ -74,6 +75,8 @@ static pgut_option options[] =
74
75
{'u' ,6 ,"timeline" ,& target_tli ,SOURCE_CMDLINE },
75
76
/* delete options */
76
77
{'b' ,12 ,"wal" ,& delete_wal },
78
+ /* other */
79
+ {'U' ,13 ,"system-identifier" ,& system_identifier ,SOURCE_FILE },
77
80
{0 }
78
81
};
79
82
@@ -188,10 +191,16 @@ main(int argc, char *argv[])
188
191
{
189
192
pgBackupOption bkupopt ;
190
193
int res ;
194
+ uint64 _system_identifier ;
191
195
bkupopt .smooth_checkpoint = smooth_checkpoint ;
192
196
bkupopt .keep_data_generations = keep_data_generations ;
193
197
bkupopt .keep_data_days = keep_data_days ;
194
198
199
+ _system_identifier = get_system_identifier (true);
200
+ if (_system_identifier != system_identifier )
201
+ elog (ERROR ,"Backup directory was initialized for system id = %ld, but target system id = %ld" ,
202
+ system_identifier ,_system_identifier );
203
+
195
204
/* Do the backup */
196
205
res = do_backup (bkupopt );
197
206
if (res != 0 )