repmgrd: log execution error in "repmgrd_get_local_node_id()"

That shouldn't happen, but if it does it will make it easier to
identify the issue.
This commit is contained in:
Ian Barwick
2018-01-16 11:14:04 +09:00
parent 0eca08ffaf
commit 54b5c8ad94

View File

@@ -1608,7 +1608,12 @@ repmgrd_get_local_node_id(PGconn *conn)
res = PQexec(conn, "SELECT repmgr.get_local_node_id()");
if (!PQgetisnull(res, 0, 0))
if (PQresultStatus(res) != PGRES_TUPLES_OK)
{
log_error(_("unable to execute \"SELECT repmgr.get_local_node_id()\""));
log_detail("%s", PQerrorMessage(conn));
}
else if (!PQgetisnull(res, 0, 0))
{
local_node_id = atoi(PQgetvalue(res, 0, 0));
}