From 0d333d8663673692642941ed418ed0aa243f0de6 Mon Sep 17 00:00:00 2001 From: Darold Gilles Date: Mon, 28 Oct 2013 16:27:36 +0100 Subject: [PATCH] Fix missing queries using temp files and locks with CSV log files. Thanks to avandras for the report. --- pgbadger | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pgbadger b/pgbadger index 45480d3..ab8db11 100755 --- a/pgbadger +++ b/pgbadger @@ -5286,6 +5286,15 @@ sub parse_query # Store current lock information that will be used later # when we will parse the query responsible of the locks $cur_lock_info{$t_pid}{wait} = $3; + if ($format eq 'csv') { + $cur_lock_info{$t_pid}{query} = $prefix_vars{'t_statement'}; + $cur_lock_info{$t_pid}{timestamp} = $prefix_vars{'t_timestamp'}; + $cur_lock_info{$t_pid}{dbname} = $prefix_vars{'t_dbname'}; + $cur_lock_info{$t_pid}{dbuser} = $prefix_vars{'t_dbuser'}; + $cur_lock_info{$t_pid}{dbclient} = $prefix_vars{'t_client'}; + $cur_lock_info{$t_pid}{dbappname} = $prefix_vars{'t_appname'}; + $cur_lock_info{$t_pid}{timestamp} = $prefix_vars{'t_timestamp'}; + } return; } @@ -5312,6 +5321,15 @@ sub parse_query # Store current temporary file information that will be used later # when we will parse the query responsible of the tempfile $cur_temp_info{$t_pid}{size} = $1; + if ($format eq 'csv') { + $cur_temp_info{$t_pid}{query} = $prefix_vars{'t_statement'}; + $cur_temp_info{$t_pid}{timestamp} = $prefix_vars{'t_timestamp'}; + $cur_temp_info{$t_pid}{dbname} = $prefix_vars{'t_dbname'}; + $cur_temp_info{$t_pid}{dbuser} = $prefix_vars{'t_dbuser'}; + $cur_temp_info{$t_pid}{dbclient} = $prefix_vars{'t_client'}; + $cur_temp_info{$t_pid}{dbappname} = $prefix_vars{'t_appname'}; + $cur_temp_info{$t_pid}{timestamp} = $prefix_vars{'t_timestamp'}; + } return; } -- 2.40.0