standby clone: emit pg_basebackup command in --dry-run mode

This commit is contained in:
Ian Barwick
2020-11-04 12:00:42 +09:00
parent 674c06d01c
commit 8543c0bcf6

View File

@@ -670,6 +670,15 @@ do_standby_clone(void)
log_hint(_("consider using the -c/--fast-checkpoint option")); log_hint(_("consider using the -c/--fast-checkpoint option"));
} }
if (mode == pg_basebackup)
{
/*
* In --dry-run mode, this will just output the pg_basebackup command which
* would be executed.
*/
run_basebackup(&local_node_record);
}
PQfinish(source_conn); PQfinish(source_conn);
log_info(_("all prerequisites for \"standby clone\" are met")); log_info(_("all prerequisites for \"standby clone\" are met"));
@@ -6776,6 +6785,13 @@ run_basebackup(t_node_info *node_record)
termPQExpBuffer(&params); termPQExpBuffer(&params);
if (runtime_options.dry_run == true)
{
log_info(_("would execute:\n %s"), script.data);
termPQExpBuffer(&script);
return SUCCESS;
}
log_info(_("executing:\n %s"), script.data); log_info(_("executing:\n %s"), script.data);
/* /*