repmgr master register: support --dry-run

This commit is contained in:
Ian Barwick
2017-06-14 09:18:38 +09:00
parent 6af75a1151
commit dd06c82821
2 changed files with 25 additions and 3 deletions

View File

@@ -1263,7 +1263,7 @@ create_repmgr_extension(PGconn *conn)
switch(extension_status)
{
case REPMGR_UNKNOWN:
log_error(_("unable to determine status of repmgr extension"));
log_error(_("unable to determine status of \"repmgr\" extension"));
return false;
case REPMGR_UNAVAILABLE:
@@ -1276,9 +1276,15 @@ create_repmgr_extension(PGconn *conn)
return true;
case REPMGR_AVAILABLE:
log_notice(_("attempting to install extension \"repmgr\""));
if (runtime_options.dry_run == true)
{
log_notice(_("would now attempt to install extension \"repmgr\""));
}
else
{
log_notice(_("attempting to install extension \"repmgr\""));
}
break;
}
/* 3. Attempt to get a superuser connection */
@@ -1287,6 +1293,9 @@ create_repmgr_extension(PGconn *conn)
get_superuser_connection(&conn, &superuser_conn, &schema_create_conn);
if (runtime_options.dry_run == true)
return true;
/* 4. Create extension */
initPQExpBuffer(&query);