mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
Update handling of --replication-user
This commit is contained in:
@@ -204,6 +204,11 @@ main(int argc, char **argv)
|
|||||||
runtime_options.force = true;
|
runtime_options.force = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* --replication-user (master/standby register only) */
|
||||||
|
case OPT_REPLICATION_USER:
|
||||||
|
strncpy(runtime_options.replication_user, optarg, MAXLEN);
|
||||||
|
break;
|
||||||
|
|
||||||
/* -W/--wait */
|
/* -W/--wait */
|
||||||
case 'W':
|
case 'W':
|
||||||
runtime_options.wait = true;
|
runtime_options.wait = true;
|
||||||
@@ -350,10 +355,6 @@ main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case OPT_REPLICATION_USER:
|
|
||||||
strncpy(runtime_options.replication_user, optarg, MAXLEN);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case OPT_UPSTREAM_CONNINFO:
|
case OPT_UPSTREAM_CONNINFO:
|
||||||
strncpy(runtime_options.upstream_conninfo, optarg, MAXLEN);
|
strncpy(runtime_options.upstream_conninfo, optarg, MAXLEN);
|
||||||
break;
|
break;
|
||||||
@@ -1066,6 +1067,25 @@ check_cli_parameters(const int action)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (runtime_options.replication_user[0])
|
||||||
|
{
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case MASTER_REGISTER:
|
||||||
|
case STANDBY_REGISTER:
|
||||||
|
break;
|
||||||
|
case STANDBY_CLONE:
|
||||||
|
case STANDBY_FOLLOW:
|
||||||
|
item_list_append_format(&cli_warnings,
|
||||||
|
_("--replication-user ignored when executing %s)"),
|
||||||
|
action_name(action));
|
||||||
|
default:
|
||||||
|
item_list_append_format(&cli_warnings,
|
||||||
|
_("--replication-user not required when executing %s"),
|
||||||
|
action_name(action));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (runtime_options.limit_provided)
|
if (runtime_options.limit_provided)
|
||||||
{
|
{
|
||||||
switch (action)
|
switch (action)
|
||||||
|
|||||||
Reference in New Issue
Block a user