summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorMichel Sijmons2011-02-02 22:30:01 +0000
committerGreg Sabino Mullane2011-02-02 22:30:01 +0000
commitd6c366f030d4689e2acbb46a5167ddb5bb294b45 (patch)
tree2ece5004db95d2284d08abfbfa26a95c0085e0db /check_postgres.pl
parentbcf901de0225b49eb24b9400a9315a9a56e4151e (diff)
Support non-standard version strings in the bloat check.
With help from Gurjeet Singh
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index a9e35eb78..8bca7bd98 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -2919,7 +2919,8 @@ FROM (
FROM pg_stats s, (
SELECT
BLOCK_SIZE,
- CASE WHEN substring(v,12,3) IN ('8.0','8.1','8.2') THEN 27 ELSE 23 END AS hdr,
+ CASE WHEN SUBSTRING(SPLIT_PART(v, ' ', 2) FROM '#"[0-9]+.[0-9]+#"%' for '#')
+ IN ('8.0','8.1','8.2') THEN 27 ELSE 23 END AS hdr,
CASE WHEN v ~ 'mingw32' OR v ~ '64-bit' THEN 8 ELSE 4 END AS ma
FROM (SELECT version() AS v) AS foo
) AS constants