diff options
author | Greg Sabino Mullane | 2009-10-14 12:37:59 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2009-10-14 12:37:59 +0000 |
commit | 81297119268146c8a3ff6b897095f0dba9e153a5 (patch) | |
tree | 7f9b8bb7d6c4f79d67c431457d02e91d64ec17cc /check_postgres.pl | |
parent | f014a0087ac1ed78a4e8a9bffcb39551ab24db33 (diff) |
Fix for bloat action against old versions of Postgres without the 'block_size' param.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-x | check_postgres.pl | 10 |
1 files changed, 9 insertions, 1 deletions
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<Version 2.11.1> (August 27, 2009) |