From 58aa55ee691b7c9dbd0e30e39561787d454b3158 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 8 Mar 2012 21:53:24 +0100 Subject: [PATCH] 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!). --- src/postgresql.c | 3 --- 1 file changed, 3 deletions(-) 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); -- 2.30.2