From 1e8b9e89600b6848a337be4f84132a9594e45ad4 Mon Sep 17 00:00:00 2001 From: Jaime Casanova Date: Sun, 8 May 2011 19:26:59 -0500 Subject: [PATCH] Add a fallback_application_name parameter to conninfo to identify the connection if application_name is not set --- dbutils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dbutils.c b/dbutils.c index c3a3be22..746bb983 100644 --- a/dbutils.c +++ b/dbutils.c @@ -25,7 +25,12 @@ PGconn * establishDBConnection(const char *conninfo, const bool exit_on_error) { /* Make a connection to the database */ - PGconn *conn = PQconnectdb(conninfo); + PGconn *conn = NULL; + char connection_string[MAXLEN]; + + strcpy(connection_string, conninfo); + strcat(connection_string, " fallback_application_name='repmgr'"); + conn = PQconnectdb(connection_string); /* Check to see that the backend connection was successfully made */ if ((PQstatus(conn) != CONNECTION_OK))