Skip to content

Commit

Permalink
Add "witness" as a node role in CLUSTER SHOW
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaime Casanova authored and Jaime Casanova committed Aug 8, 2011
1 parent f26e37c commit 10817ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion repmgr.c
Expand Up @@ -370,7 +370,7 @@ do_cluster_show(void)
log_info(_("%s connecting to database\n"), progname);
conn = establishDBConnection(options.conninfo, true);

sqlquery_snprintf(sqlquery, "SELECT conninfo FROM %s.repl_nodes;", repmgr_schema);
sqlquery_snprintf(sqlquery, "SELECT conninfo, witness FROM %s.repl_nodes;", repmgr_schema);
res = PQexec(conn, sqlquery);

if (PQresultStatus(res) != PGRES_TUPLES_OK)
Expand All @@ -388,6 +388,8 @@ do_cluster_show(void)
conn = establishDBConnection(PQgetvalue(res, i, 0), false);
if (PQstatus(conn) != CONNECTION_OK)
strcpy(node_role, " FAILED");
else if (strcmp(PQgetvalue(res, i, 1), "t") == 0)
strcpy(node_role, " witness");
else if (is_standby(conn))
strcpy(node_role, " standby");
else
Expand Down

0 comments on commit 10817ec

Please sign in to comment.