mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
poke it around until it works less badly
This commit is contained in:
26
dbutils.c
26
dbutils.c
@@ -2364,6 +2364,32 @@ set_voting_status_initiated(PGconn *conn)
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
announce_candidature(PGconn *conn, t_node_info *this_node, t_node_info *other_node)
|
||||
{
|
||||
PQExpBufferData query;
|
||||
PGresult *res;
|
||||
|
||||
bool retval;
|
||||
|
||||
initPQExpBuffer(&query);
|
||||
|
||||
appendPQExpBuffer(&query,
|
||||
"SELECT repmgr.other_node_is_candidate(%i)",
|
||||
this_node->node_id);
|
||||
|
||||
res = PQexec(conn, query.data);
|
||||
termPQExpBuffer(&query);
|
||||
|
||||
retval = (strcmp(PQgetvalue(res, 0, 0), "t") == 0)
|
||||
? true
|
||||
: false;
|
||||
|
||||
PQclear(res);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* ============================ */
|
||||
/* replication status functions */
|
||||
/* ============================ */
|
||||
|
||||
Reference in New Issue
Block a user