diff --git a/repmgrd.c b/repmgrd.c index 68981d72..5bdda400 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -1580,7 +1580,10 @@ do_master_failover(void) return; } + + /* Close the connection to this server */ PQfinish(my_local_conn); + my_local_conn = NULL; /* XXX double-check the promotion candidate did become the new primary */ @@ -1596,9 +1599,6 @@ do_master_failover(void) fflush(stderr); } - /* Close the connection to this server */ - PQfinish(my_local_conn); - my_local_conn = NULL; log_debug(_("executing follow command: \"%s\"\n"), local_options.follow_command);