From: Michel Sijmons Date: Wed, 2 Feb 2011 22:30:01 +0000 (-0500) Subject: Support non-standard version strings in the bloat check. X-Git-Tag: 2.18.0~118 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=d6c366f030d4689e2acbb46a5167ddb5bb294b45;p=check_postgres.git Support non-standard version strings in the bloat check. With help from Gurjeet Singh --- 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