postgresql plugin: Use the "right" `interval' when passing a param to a query.
authorSebastian Harl <sh@tokkee.org>
Fri, 26 Mar 2010 20:30:17 +0000 (21:30 +0100)
committerSebastian Harl <sh@tokkee.org>
Fri, 26 Mar 2010 20:30:17 +0000 (21:30 +0100)
… i.e., use the database specific interval, if configured.

src/collectd.conf.pod
src/postgresql.c

index 943a089..e5782e0 100644 (file)
@@ -3052,7 +3052,8 @@ The username used to connect to the database.
 
 =item I<interval>
 
-The interval collectd is using (as specified by the B<Interval> option).
+The interval with which this database is queried (as specified by the database
+specific or global B<Interval> options).
 
 =back
 
index 6698e0e..0141b23 100644 (file)
@@ -315,7 +315,8 @@ static PGresult *c_psql_exec_query_params (c_psql_database_t *db,
                                params[i] = db->user;
                                break;
                        case C_PSQL_PARAM_INTERVAL:
-                               ssnprintf (interval, sizeof (interval), "%i", interval_g);
+                               ssnprintf (interval, sizeof (interval), "%i",
+                                               db->interval > 0 ? db->interval : interval_g);
                                params[i] = interval;
                                break;
                        default: