projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb1de94
)
postgresql plugin: Don't do any SQL query when checking the connection.
author
Sebastian Harl
<sh@tokkee.org>
Thu, 8 Mar 2012 20:53:24 +0000
(21:53 +0100)
committer
Sebastian Harl
<sh@tokkee.org>
Mon, 28 Jan 2013 21:08:21 +0000
(22:08 +0100)
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
patch
|
blob
|
history
diff --git
a/src/postgresql.c
b/src/postgresql.c
index
6c9ab44
..
e3a6674
100644
(file)
--- 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);