From: Gilles Darold Date: Wed, 10 Aug 2016 18:01:20 +0000 (+0200) Subject: Fix report of deadlock and error with detail+statement and pl/pgSQL statement. X-Git-Tag: v8.2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ec11009e8c56039b4ec453693501e98efd27c5ed;p=pgbadger Fix report of deadlock and error with detail+statement and pl/pgSQL statement. --- diff --git a/pgbadger b/pgbadger index 2dacc51..b4f9d44 100755 --- a/pgbadger +++ b/pgbadger @@ -3084,7 +3084,7 @@ sub parse_orphan_line } elsif (exists $cur_info{$cur_pid}{context}) { $cur_info{$cur_pid}{context} .= "\n" . $line; # Append to the query detail if one is defined - } elsif ($error_only && exists $cur_info{$cur_pid}{detail}) { + } elsif (exists $cur_info{$cur_pid}{detail}) { $cur_info{$cur_pid}{detail} .= "\n" . $line; # After all append to the query if one is defined } elsif (exists $cur_info{$cur_pid}{query}) { @@ -9808,7 +9808,7 @@ sub print_most_frequent $max $avg -
$query
$md5 +
$query
$md5

Times Reported Time consuming queries #$rank

@@ -12177,12 +12177,6 @@ sub parse_query $prefix_vars{'t_query'} =~ s/#011/\t/g; } - # Reject lines generated by debug tool - if ( ($prefix_vars{'t_loglevel'} eq 'CONTEXT') && ($prefix_vars{'t_query'} =~ /SQL statement "/) ) { - return; - } - - # Save previous temporary file information with same pid to not overwrite it if ($prefix_vars{'t_loglevel'} =~ $main_log_regex) { if (($prefix_vars{'t_query'} !~ /temporary file: path .*, size \d+/) && exists $cur_temp_info{$t_pid}) { @@ -12206,7 +12200,7 @@ sub parse_query # Special cases when a STATEMENT is parsed if ($prefix_vars{'t_loglevel'} eq 'STATEMENT') { # Stores temporary file statement if a temporary record with the same pid exists - if ( exists $cur_temp_info{$t_pid} ) { + if ( exists $cur_temp_info{$t_pid}{size}) { # Store query of the last temporary file found. $cur_temp_info{$t_pid}{query} = $prefix_vars{'t_query'}; return;