repmgr: use provided --replication-user in pg_basebackup mode

This commit is contained in:
Ian Barwick
2016-12-26 12:38:22 +09:00
parent 6e14f0bc5d
commit a6f1c6e483

View File

@@ -6991,7 +6991,11 @@ run_basebackup(const char *data_dir, int server_version)
appendPQExpBuffer(&params, " -p %s", runtime_options.masterport);
}
if (strlen(runtime_options.username))
if (strlen(runtime_options.replication_user))
{
appendPQExpBuffer(&params, " -U %s", runtime_options.replication_user);
}
else if (strlen(runtime_options.username))
{
appendPQExpBuffer(&params, " -U %s", runtime_options.username);
}
@@ -8048,6 +8052,9 @@ check_upstream_config(PGconn *conn, int server_version_num, bool exit_on_error)
param_set(&repl_conninfo, "replication", "1");
if (*runtime_options.replication_user)
param_set(&repl_conninfo, "user", runtime_options.replication_user);
/*
* work out how many replication connections are required (1 or 2)
*/