mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
A few fixes product of Cedric Villemain's review
This commit is contained in:
11
repmgr.c
11
repmgr.c
@@ -551,7 +551,9 @@ do_standby_promote(void)
|
||||
fprintf(stderr, _("Ignoring dest-dir option because it has no meaning while promoting"));
|
||||
|
||||
/* Connection parameters for standby. always use localhost for standby */
|
||||
keywords[0] = "host";
|
||||
values[0] = "localhost";
|
||||
keywords[1] = "port";
|
||||
values[1] = standbyport;
|
||||
|
||||
/* We need to connect to check configuration */
|
||||
@@ -563,6 +565,13 @@ do_standby_promote(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_supported_version(conn))
|
||||
{
|
||||
PQfinish(conn);
|
||||
fprintf(stderr, _("%s needs PostgreSQL 9.0 or better\n"), progname);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check we are in a standby node */
|
||||
if (!is_standby(conn))
|
||||
{
|
||||
@@ -619,7 +628,9 @@ do_standby_follow(void)
|
||||
char data_dir[MAXLEN];
|
||||
|
||||
/* Connection parameters for master */
|
||||
keywords[0] = "host";
|
||||
values[0] = host;
|
||||
keywords[1] = "port";
|
||||
values[1] = masterport;
|
||||
|
||||
conn = PQconnectdbParams(keywords, values, true);
|
||||
|
||||
Reference in New Issue
Block a user