From: Darold Gilles Date: Mon, 13 May 2013 09:54:31 +0000 (+0200) Subject: Fix some parsing issue with log generated by pg 7.4 X-Git-Tag: v3.4~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a018efd827c6fb9e6fd912b9693890b16dc5b24d;p=pgbadger Fix some parsing issue with log generated by pg 7.4 --- diff --git a/pgbadger b/pgbadger index e058d83..d6c1e59 100755 --- a/pgbadger +++ b/pgbadger @@ -1365,7 +1365,11 @@ sub process_file # Collect additional query information } elsif ($cur_pid && ($line !~ $orphan_stderr_line)) { - if ($cur_info{$cur_pid}{vacuum} && ($line =~ /^\t(pages|tuples|buffer usage|avg read rate|system usage):/)) { + if ($line =~ s/^(STATEMENT|DETAIL|HINT):\s+//) { + $line =~ s/ERROR:\s+//; + $cur_info{$cur_pid}{"\L$1\E"} = $line; + next; + } elsif ($cur_info{$cur_pid}{vacuum} && ($line =~ /^\t(pages|tuples|buffer usage|avg read rate|system usage):/)) { if ($line =~ /^\t(pages|tuples): (\d+) removed, (\d+) remain/) { $autovacuum_info{tables}{$cur_info{$cur_pid}{vacuum}}{$1}{removed} += $2; } @@ -5834,6 +5838,7 @@ sub normalize_error $orig_query =~ s/\(.*\)/\(...\)/g; $orig_query =~ s/column .* does not exist/column "..." does not exist/; $orig_query =~ s/(database system was shut down at).*/$1 .../; + $orig_query =~ s/(relation) \d+ (deleted while still in use)/$1 ... $2/g; # Need more normalization stuff here