From 81297119268146c8a3ff6b897095f0dba9e153a5 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Wed, 14 Oct 2009 08:37:59 -0400 Subject: Fix for bloat action against old versions of Postgres without the 'block_size' param. --- check_postgres.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'check_postgres.pl') diff --git a/check_postgres.pl b/check_postgres.pl index 8db45a6c7..11a3348ab 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -2625,7 +2625,7 @@ FROM ( ) AS nullhdr FROM pg_stats s, ( SELECT - (SELECT current_setting('block_size')::numeric) AS bs, + BLOCK_SIZE, CASE WHEN substring(v,12,3) IN ('8.0','8.1','8.2') THEN 27 ELSE 23 END AS hdr, CASE WHEN v ~ 'mingw32' THEN 8 ELSE 4 END AS ma FROM (SELECT version() AS v) AS foo @@ -2648,6 +2648,13 @@ FROM ( $SQL .= ' ORDER BY wastedbytes DESC'; } + if ($psql_version <= 7.4) { + $SQL =~ s/BLOCK_SIZE/(SELECT 8192) AS bs/; + } + else { + $SQL =~ s/BLOCK_SIZE/(SELECT current_setting('block_size')::numeric) AS bs/; + } + my $info = run_command($SQL); if (defined $info->{db}[0] and exists $info->{db}[0]{error}) { @@ -7902,6 +7909,7 @@ Items not specifically attributed are by Greg Sabino Mullane. For "same_schema" trigger mismatches, show the attached table. Add the new_version_bc check for Bucardo version checking. Add database name to perf output for last_vacuum|analyze (Guillaume Lelarge) + Fix for bloat action against old versions of Postgres without the 'block_size' param. =item B (August 27, 2009) -- cgit v1.2.3