mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 08:56:29 +00:00
Add a fallback_application_name parameter to conninfo to identify
the connection if application_name is not set
This commit is contained in:
@@ -25,7 +25,12 @@ PGconn *
|
|||||||
establishDBConnection(const char *conninfo, const bool exit_on_error)
|
establishDBConnection(const char *conninfo, const bool exit_on_error)
|
||||||
{
|
{
|
||||||
/* Make a connection to the database */
|
/* 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 */
|
/* Check to see that the backend connection was successfully made */
|
||||||
if ((PQstatus(conn) != CONNECTION_OK))
|
if ((PQstatus(conn) != CONNECTION_OK))
|
||||||
|
|||||||
Reference in New Issue
Block a user