From: Greg Sabino Mullane Date: Wed, 1 May 2013 01:18:37 +0000 (-0400) Subject: Do not use pg_stats "inherited" column in bloat query, if the database is 8.4 or... X-Git-Tag: 2.20.1~16 X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=df22e6a100ca3d1e2d2d4d2152fa110fd4c109c3;p=check_postgres.git Do not use pg_stats "inherited" column in bloat query, if the database is 8.4 or older. Technically, we are not checking the target's version. --- diff --git a/check_postgres.pl b/check_postgres.pl index e023844b8..c7c777f49 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -3605,6 +3605,10 @@ FROM ( $SQL =~ s/BLOCK_SIZE/(SELECT current_setting('block_size')::numeric) AS bs/; } + if ($psql_version <= 8.4) { + $SQL =~ s/AND s.inherited=false//; + } + my $info = run_command($SQL); if (defined $info->{db}[0] and exists $info->{db}[0]{error}) { @@ -9761,6 +9765,8 @@ Items not specifically attributed are by GSM (Greg Sabino Mullane). Compute correct 'totalwastedbytes' in the bloat query (Michael Renner) + Do not use pg_stats "inherited" column in bloat query, if the + database is 8.4 or older. (Greg Sabino Mullane, per bug 121) =item B March 13, 2013