mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
fix: correctly check the return value of PQexec()
not only check if return value is not NULL but also check that the returned result is a PGRES_COMMAND_OK (e.g. the INSERT was successful)
This commit is contained in:
3
repmgr.c
3
repmgr.c
@@ -743,7 +743,8 @@ do_standby_register(void)
|
||||
options.conninfo, options.priority);
|
||||
log_debug(_("standby register: %s\n"), sqlquery);
|
||||
|
||||
if (!PQexec(master_conn, sqlquery))
|
||||
res = PQexec(master_conn, sqlquery);
|
||||
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
|
||||
{
|
||||
log_err(_("Cannot insert node details, %s\n"),
|
||||
PQerrorMessage(master_conn));
|
||||
|
||||
Reference in New Issue
Block a user