Code

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 943a089765b2c23d0c8a793fadd1d7e75a18d6fd..e5782e0f54f1e13c532e8bc5a1390a7e4391e5a1 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 6698e0ee4dba81ea5995bff4635ef97d031735c4..0141b23e22bed1236cc92bc8bd6a338f3689547a 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: