$SQL .= $USERWHERECLAUSE;
}
- my $info = run_command($SQL, {emptyok => 1});
+ my $SQL8 = $SQL;
+ $SQL8 =~ s/pg_table_size/pg_relation_size/g; # 8.4 and earlier
+
+ my $info = run_command($SQL, {emptyok => 1, version => [ "<9.0 $SQL8" ] });
my $found = 0;
for $db (@{$info->{db}}) {
=item B<Version 2.22.1> Released ????
- Change table_size to use pg_table_size(), i.e. to include the TOAST table
- size in the numbers reported. Add new actions indexes_size and
+ Change table_size to use pg_table_size() on 9.0+, i.e. include the TOAST
+ table size in the numbers reported. Add new actions indexes_size and
total_relation_size, using the respective pg_indexes_size() and
pg_total_relation_size() functions. All size checks will now also check
materialized views where applicable.
next if $action =~ /last_auto/;
my $match = $action;
+ $match = 'relation_size' if $match =~ /^(index|table|indexes|total_relation)_size/;
$match = 'pgb_pool' if $match =~ /pgb_pool/;
if ($slurp !~ /\n\s*sub check_$match/) {