]> granicus.if.org Git - pgbadger/commitdiff
Normalize query with binded parameters, they are replaced with a ?.
authorDarold Gilles <gilles@darold.net>
Thu, 9 Mar 2017 19:03:14 +0000 (20:03 +0100)
committerDarold Gilles <gilles@darold.net>
Thu, 9 Mar 2017 19:03:14 +0000 (20:03 +0100)
pgbadger

index 32bba6e7c9354d9221a71c285a8ecaebfd822a6e..ec1b8d6d50e4381b89d6e302dad19767e909da0a 100644 (file)
--- a/pgbadger
+++ b/pgbadger
@@ -3519,8 +3519,11 @@ sub normalize_query
        # Remove hexadecimal numbers
        $orig_query =~ s/([^a-z_\$-])0x[0-9a-f]{1,10}/${1}0x/gs;
 
+       # Remove bind parameters
+       $orig_query =~ s/\$\d+/\?/gs;
+
        # Remove IN values
-       $orig_query =~ s/\bin\s*\([\'0x,\s]*\)/in (...)/gs;
+       $orig_query =~ s/\bin\s*\([\'0x,\s\?]*\)/in (...)/gs;
 
        # Remove curor names in CURSOR and IN clauses
        $orig_query =~ s/\b(declare|in)\s+"[^"]+"/$1 "..."/gs;