mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 00:46:29 +00:00
repmgrd: fix pidfile handling at shutdown
This commit is contained in:
16
dbutils.c
16
dbutils.c
@@ -1908,8 +1908,20 @@ repmgrd_set_pid(PGconn *conn, pid_t repmgrd_pid, const char *pidfile)
|
|||||||
initPQExpBuffer(&query);
|
initPQExpBuffer(&query);
|
||||||
|
|
||||||
appendPQExpBuffer(&query,
|
appendPQExpBuffer(&query,
|
||||||
"SELECT repmgr.set_repmgrd_pid(%i, '%s')",
|
"SELECT repmgr.set_repmgrd_pid(%i, ",
|
||||||
(int) repmgrd_pid, pidfile);
|
(int) repmgrd_pid);
|
||||||
|
|
||||||
|
if (pidfile != NULL)
|
||||||
|
{
|
||||||
|
appendPQExpBuffer(&query,
|
||||||
|
" '%s')",
|
||||||
|
pidfile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
appendPQExpBufferStr(&query,
|
||||||
|
" '')");
|
||||||
|
}
|
||||||
|
|
||||||
res = PQexec(conn, query.data);
|
res = PQexec(conn, query.data);
|
||||||
termPQExpBuffer(&query);
|
termPQExpBuffer(&query);
|
||||||
|
|||||||
Reference in New Issue
Block a user