]> granicus.if.org Git - pgbadger/commitdiff
Fix false autodetection of CSV format when log_statement is enable or in possible...
authorDarold Gilles <gilles@darold.net>
Thu, 6 Sep 2012 13:38:12 +0000 (15:38 +0200)
committerDarold Gilles <gilles@darold.net>
Thu, 6 Sep 2012 13:38:12 +0000 (15:38 +0200)
pgbadger

index d8d7449fc00f7b6a72c68654e3e66984a889deb4..a6504d877f36c899da3c3fbecc16e103b0b0a90e 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -3498,7 +3498,7 @@ sub autodetect_format
                } elsif ($line =~ /\d+-\d+-\d+\s\d+:\d+:\d+\s[^\s]+\s\[\d+\]:\s\[[0-9\-]+\](.*?)(LOG|WARNING|ERROR|FATAL|PANIC|DETAIL|STATEMENT|HINT|CONTEXT):\s+$duration/) {
                        $fmt = 'stderr';
                        $nfound++;
-               } elsif ($line =~ tr/,/,/ >= 12) {
+               } elsif ( ($line =~ /,(LOG|WARNING|ERROR|FATAL|PANIC|DETAIL|STATEMENT|HINT|CONTEXT),/) && ($line =~ tr/,/,/ >= 12) ) {
                        $fmt = 'csv';
                        $nfound++;
                }