]> granicus.if.org Git - pgbadger/commitdiff
Add more "normalization" on errors messages
authorDarold Gilles <gilles@darold.net>
Fri, 27 Apr 2012 10:30:29 +0000 (12:30 +0200)
committerDarold Gilles <gilles@darold.net>
Fri, 27 Apr 2012 10:30:29 +0000 (12:30 +0200)
pgbadger

index 09b0ccc09ea47fca0cc4638060d84ffbf2b72289..9c01c170775f1927c1f2ab931e00097004013d56 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -2001,9 +2001,16 @@ sub normalize_error
        my $orig_query = shift;
 
        return if (!$orig_query);
-
+       
        # Remove character position
        $orig_query =~ s/ at character \d+//;
+       # Remove encoding detail
+       $orig_query =~ s/(byte sequence for encoding).*/$1/;
+       # Replace changing parameter by ...
+       $orig_query =~ s/"[^"]*"/"..."/g;
+       $orig_query =~ s/\(.*\)/\(...\)/g;
+       $orig_query =~ s/column .* does not exist/column "..." does not exist/;
+       # Need more normalization stuff here
 
        return $orig_query;
 }