[collectd] [PATCH 4/5] postgresql_default.conf: Split "queries" query into two versions.

Sebastian Harl sh at tokkee.org
Tue Aug 26 16:11:26 CEST 2008


The "n_tup_hot_upd" column has been added in 8.3. The two versions of the
"queries" query now take that into account by defining different SQL queries
for versions up to 8.2.99 and versions starting with 8.3.

Signed-off-by: Sebastian Harl <sh at tokkee.org>
---
 src/postgresql_default.conf |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/postgresql_default.conf b/src/postgresql_default.conf
index decf39f..61844a0 100644
--- a/src/postgresql_default.conf
+++ b/src/postgresql_default.conf
@@ -22,6 +22,17 @@
 </Query>
 
 <Query queries>
+	Query "SELECT sum(n_tup_ins), sum(n_tup_upd), sum(n_tup_del) \
+		FROM pg_stat_user_tables;"
+
+	Column pg_n_tup_c ins
+	Column pg_n_tup_c upd
+	Column pg_n_tup_c del
+
+	MaxPGVersion 80299
+</Query>
+
+<Query queries>
 	Query "SELECT sum(n_tup_ins), sum(n_tup_upd), sum(n_tup_del), \
 			sum(n_tup_hot_upd) \
 		FROM pg_stat_user_tables;"
@@ -30,6 +41,8 @@
 	Column pg_n_tup_c upd
 	Column pg_n_tup_c del
 	Column pg_n_tup_c hot_upd
+
+	MinPGVersion 80300
 </Query>
 
 <Query query_plans>
-- 
1.6.0.90.g436ed

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080826/dc5483fc/attachment-0001.pgp 


More information about the collectd mailing list