summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a025295)
raw | patch | inline | side by side (parent: a025295)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 7 Mar 2009 16:43:54 +0000 (17:43 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 7 Mar 2009 17:00:19 +0000 (18:00 +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.
src/postgresql_default.conf | patch | blob | history |
index 61844a024aa648def479fcf3171c00c29d745d0e..5b024ca14aca2976a4ef99e9c183a390a8891210 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
Column pg_db_size
</Query>
+# vim: set ft=config :
+