Various improvements to database parameter handling

With "standby clone" also better indicate whether the repmgr extension
is actually available.
This commit is contained in:
Ian Barwick
2017-05-04 23:15:28 +09:00
parent fe7598d230
commit bb362bdb7e
2 changed files with 171 additions and 6 deletions

View File

@@ -534,12 +534,12 @@ check_barman_config(void)
static void
check_source_server()
{
PGconn *superuser_conn = NULL;
PGconn *privileged_conn = NULL;
PGconn *superuser_conn = NULL;
PGconn *privileged_conn = NULL;
char cluster_size[MAXLEN];
t_node_info node_record = T_NODE_INFO_INITIALIZER;
int query_result;
char cluster_size[MAXLEN];
t_node_info node_record = T_NODE_INFO_INITIALIZER;
int query_result;
t_extension_status extension_status;
/* Attempt to connect to the upstream server to verify its configuration */
@@ -625,8 +625,25 @@ check_source_server()
{
if (!runtime_options.force)
{
if (extension_status == REPMGR_UNKNOWN)
{
PQfinish(source_conn);
exit(ERR_DB_QUERY);
}
/* schema doesn't exist */
log_error(_("repmgr extension not found on source node"));
if (extension_status == REPMGR_AVAILABLE)
{
log_detail(_("repmgr extension is available but not installed in database \"%s\""),
param_get(&source_conninfo, "dbname"));
}
else if (extension_status == REPMGR_UNAVAILABLE)
{
log_detail(_("repmgr extension is not available on the upstream server"));
}
log_hint(_("check that the upstream server is part of a repmgr cluster"));
PQfinish(source_conn);
exit(ERR_BAD_CONFIG);