add application_name to pgbouncer connectio string

This commit is contained in:
Grant Limberg 2018-12-10 12:26:20 -08:00
parent e23d95bf03
commit 0da2efa633
3 changed files with 10 additions and 2 deletions

View file

@ -1349,7 +1349,10 @@ PGconn *PostgreSQL::getPgConn(OverrideMode m) {
char *connStr = getenv("PGBOUNCER_CONNSTR");
if (connStr != NULL) {
fprintf(stderr, "PGBouncer Override\n");
return PQconnectdb(connStr);
std::string conn(connStr);
conn += " application_name=controller-";
conn += _myAddressStr.c_str();
return PQconnectdb(conn.c_str());
}
}