Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions lib/PgSQL_Monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,14 +874,22 @@ string build_conn_str(const task_st_t& task_st) {
const mon_srv_t& srv_info { task_st.op_st.srv_info };
const mon_user_t& user_info { task_st.op_st.user_info };

return string {
string conn_str =
"host='" + srv_info.addr + "' "
+ "port='" + std::to_string(srv_info.port) + "' "
+ "user='" + user_info.user + "' "
+ "password='" + user_info.pass + "' "
+ "dbname='" + user_info.dbname + "' "
+ "application_name=ProxySQL-Monitor"
};
+ "port='" + std::to_string(srv_info.port) + "' "
+ "user='" + user_info.user + "' "
+ "password='" + user_info.pass + "' "
+ "dbname='" + user_info.dbname + "' "
+ "application_name=ProxySQL-Monitor ";

// Add SSL configuration based on server's use_ssl setting
if (srv_info.ssl) {
conn_str += "sslmode=require ";
} else {
conn_str += "sslmode=disable ";
}

return conn_str;
}

pgsql_conn_t create_new_conn(task_st_t& task_st) {
Expand Down