From: Sebastian Harl Date: Thu, 8 Mar 2012 20:53:24 +0000 (+0100) Subject: postgresql plugin: Don't do any SQL query when checking the connection. X-Git-Tag: collectd-5.3.0~44^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=58aa55ee691b7c9dbd0e30e39561787d454b3158;p=collectd.git postgresql plugin: Don't do any SQL query when checking the connection. First of all, this is not needed -- PQstatus() will correctly determine a failed connection without that. Secondly, the "SELECT 42" that was used before does not work, e.g. when querying PgBouncer (thanks to renchap for reporting this on IRC!). --- diff --git a/src/postgresql.c b/src/postgresql.c index 6c9ab44e..e3a66743 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -371,9 +371,6 @@ static int c_psql_check_connection (c_psql_database_t *db) c_psql_connect (db); } - /* "ping" */ - PQclear (PQexec (db->conn, "SELECT 42;")); - if (CONNECTION_OK != PQstatus (db->conn)) { PQreset (db->conn);