summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bf76edf)
raw | patch | inline | side by side (parent: bf76edf)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 9 Mar 2009 16:42:48 +0000 (17:42 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 9 Mar 2009 16:44:46 +0000 (17:44 +0100) |
Starting with some version between 8.3.3 and 8.3.6, pg_statio_*_tables returns
NULL instead of 0 for statistics if no instance of the appropriate relation
exists. PQgetvalue() returns an empty string in that case which would then
result in error messages when udb_result_submit() tries to convert that to a
number.
Now, the "disk_io" query uses PostgreSQL's coalesce() function to make sure 0
is returned instead of NULL.
NULL instead of 0 for statistics if no instance of the appropriate relation
exists. PQgetvalue() returns an empty string in that case which would then
result in error messages when udb_result_submit() tries to convert that to a
number.
Now, the "disk_io" query uses PostgreSQL's coalesce() function to make sure 0
is returned instead of NULL.
debian/changelog | patch | blob | history | |
debian/patches/postgresql_conf_fix.dpatch | patch | blob | history |
diff --git a/debian/changelog b/debian/changelog
index b0253d76b14a7f62c0c37d9915fcad0f52b6596a..ba8dfa61a344b3bf94c91ff938429305104ba817 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
all plugins are spelled lowercase.
* debian/patches/:
- Added postgresql_conf_fix.dpatch - upstream patch to fix the use of
- deprecated configuration options.
+ deprecated configuration options and to make sure the "disk_io" query
+ does not return NULLs.
- -- Sebastian Harl <sh@tokkee.org> Sat, 07 Mar 2009 17:29:39 +0100
+ -- Sebastian Harl <sh@tokkee.org> Mon, 09 Mar 2009 17:42:01 +0100
collectd (4.5.1-1) experimental; urgency=low
index 74d9e72ae0f318fac79c340c17a645dab03777af..57c5bd1de2215b565c83eaf8cbeea1b0f5883fe0 100755 (executable)
#! /bin/sh /usr/share/dpatch/dpatch-run
## postgresql_conf_fix.dpatch by Sebastian Harl <sh@tokkee.org>
##
-## DP: postgresql_default.conf: Don't use the deprecated {Min,Max}PgVersion
-## DP: options.
+## DP: postgresql_default.conf:
+## DP:
+## DP: * Don't use the deprecated {Min,Max}PgVersion options.
+## DP:
+## DP: * Make sure the "disk_io" query does not return NULLs.
+## DP:
+## DP: Starting with some version between 8.3.3 and 8.3.6,
+## DP: pg_statio_*_tables returns NULL instead of 0 for statistics if no
+## DP: instance of the appropriate relation exists. PQgetvalue() returns an
+## DP: empty string in that case which would then result in error messages
+## DP: when udb_result_submit() tries to convert that to a number.
+## DP:
+## DP: Now, the "disk_io" query uses PostgreSQL's coalesce() function to
+## DP: make sure 0 is returned instead of NULL.
@DPATCH@
</Query>
<Query disk_io>
+@@ -141,14 +141,14 @@
+ </Query>
+
+ <Query disk_io>
+- Statement "SELECT sum(heap_blks_read) AS heap_read, \
+- sum(heap_blks_hit) AS heap_hit, \
+- sum(idx_blks_read) AS idx_read, \
+- sum(idx_blks_hit) AS idx_hit, \
+- sum(toast_blks_read) AS toast_read, \
+- sum(toast_blks_hit) AS toast_hit, \
+- sum(tidx_blks_read) AS tidx_read, \
+- sum(tidx_blks_hit) AS tidx_hit \
++ Statement "SELECT coalesce(sum(heap_blks_read), 0) AS heap_read, \
++ coalesce(sum(heap_blks_hit), 0) AS heap_hit, \
++ coalesce(sum(idx_blks_read), 0) AS idx_read, \
++ coalesce(sum(idx_blks_hit), 0) AS idx_hit, \
++ coalesce(sum(toast_blks_read), 0) AS toast_read, \
++ coalesce(sum(toast_blks_hit), 0) AS toast_hit, \
++ coalesce(sum(tidx_blks_read), 0) AS tidx_read, \
++ coalesce(sum(tidx_blks_hit), 0) AS tidx_hit \
+ FROM pg_statio_user_tables;"
+
+ <Result>