From a19973dc0b0d74a71ad451179e12fe95663f30b0 Mon Sep 17 00:00:00 2001 From: Darold Gilles Date: Tue, 25 Sep 2012 11:03:38 +0200 Subject: [PATCH] Fix issue #28: Illegal division by zero with log file without query and txt output. Thanks to rlowe for the report. --- pgbadger | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgbadger b/pgbadger index ee36e42..7522110 100755 --- a/pgbadger +++ b/pgbadger @@ -1087,7 +1087,7 @@ Report not supported by text format # INSERT/DELETE/UPDATE/SELECT repartition my $totala = $overall_stat{'SELECT'} + $overall_stat{'INSERT'} + $overall_stat{'UPDATE'} + $overall_stat{'DELETE'}; - my $total = $overall_stat{'queries_number'}; + my $total = $overall_stat{'queries_number'} || 1; print $fh "\n- Queries by type ------------------------------------------------------\n\n"; print $fh "Type Count Percentage\n"; print $fh "SELECT: ", &comma_numbers($overall_stat{'SELECT'}) || 0, " ", -- 2.40.0