postgresql_default.conf: Make sure the "disk_io" query does not return NULLs.
[collectd.git] / src / postgresql_default.conf
index 61844a0..5b024ca 100644 (file)
 </Query>
 
 <Query disk_io>
-       Query "SELECT sum(heap_blks_read), sum(heap_blks_hit), \
-                       sum(idx_blks_read), sum(idx_blks_hit), \
-                       sum(toast_blks_read), sum(toast_blks_hit), \
-                       sum(tidx_blks_read), sum(tidx_blks_hit) \
+       Query "SELECT coalesce(sum(heap_blks_read), 0), \
+                       coalesce(sum(heap_blks_hit), 0), \
+                       coalesce(sum(idx_blks_read), 0), \
+                       coalesce(sum(idx_blks_hit), 0), \
+                       coalesce(sum(toast_blks_read), 0), \
+                       coalesce(sum(toast_blks_hit), 0), \
+                       coalesce(sum(tidx_blks_read), 0), \
+                       coalesce(sum(tidx_blks_hit), 0) \
                FROM pg_statio_user_tables;"
 
        Column pg_blks heap_read
@@ -91,3 +95,5 @@
        Column pg_db_size
 </Query>
 
+# vim: set ft=config :
+