]> granicus.if.org Git - pgbadger/commitdiff
Update operators list in SQL code beautifier with last update in pgFormatter. Thanks...
authorDarold Gilles <gilles@darold.net>
Sat, 6 Feb 2016 09:27:06 +0000 (10:27 +0100)
committerDarold Gilles <gilles@darold.net>
Sat, 6 Feb 2016 09:27:06 +0000 (10:27 +0100)
pgbadger

index 4342e666198354e42cee7f3778903d679bbfc0cc..b2d924e360865862e09e0a0bb0a9c2997b948c52 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -11743,44 +11743,58 @@ sub build_log_line_prefix_regex
                my ($query, $remove_white_tokens) = @_;
 
                my $re = qr{
-    (
-        (?:--)[\ \t\S]*      # single line comments
-       |
-       (?:\#|\@\-\@|\@\@|\#\#|<\->|\&<|\&>|<<\||\|>>|\&<\||\|\&>|<\^|>\^|\?\#|\?\-|\?\||\?\-\||\?\|\||\@>|<\@|\~=)
-                               # Geometric Operators
-        |
-        (?:\->>|\->|\#>|\?\&|\?)  # Json Operators
-        |
-        (?:<>|<=>|>=|<=|==|=|!=|!|<<|>>|<|>|\|\||\||&&|&|-|\+|\*(?!/)|/(?!\*)|\%|~|\^|\?)
-                                # operators and tests
-        |
-        [\[\]\(\),;.]            # punctuation (parenthesis, comma)
-        |
-        \'\'(?!\')              # empty single quoted string
-        |
-        \"\"(?!\"")             # empty double quoted string
-        |
-        "(?>(?:(?>[^"\\]+)|""|\\.)*)+"
-                                # anything inside double quotes, ungreedy
-        |
-        `(?>(?:(?>[^`\\]+)|``|\\.)*)+`
-                                # anything inside backticks quotes, ungreedy
-        |
-        '(?>(?:(?>[^'\\]+)|''|\\.)*)+'
-                                # anything inside single quotes, ungreedy.
-        |
-        /\*[\ \t\r\n\S]*?\*/      # C style comments
-        |
-        (?:[\w:@]+(?:\.(?:\w+|\*)?)*)
-                                # words, standard named placeholders, db.table.*, db.*
-        |
-        (?: \$_\$ | \$\d+ | \${1,2})
-                                # dollar expressions - eg $_$ $3 $$
-        |
-        \n                      # newline
-        |
-        [\t\ ]+                 # any kind of white spaces
-    )
+        (
+                (?:--)[\ \t\S]*      # single line comments
+                |
+                (?:\-\|\-) # range operator "is adjacent to"
+                |
+                (?:\->>|\->|\#>>|\#>|\?\&|\?)  # Json Operators
+                |
+                (?:\#<=|\#>=|\#<>|\#<|\#=) # compares tinterval and reltime
+                |
+                (?:>>=|<<=) # inet operators
+                |
+                (?:!!|\@\@\@) # deprecated factorial and full text search  operators
+                |
+                (?:\|\|\/|\|\/) # square root and cube root
+                |
+                (?:\@\-\@|\@\@|\#\#|<\->|<<\||\|>>|\&<\||\&<|\|\&>|\&>|<\^|>\^|\?\#|\#|\?<\||\?\-\||\?\-|\?\|\||\?\||\@>|<\@|\~=)
+                                 # Geometric Operators
+                |
+                (?:~<=~|~>=~|~>~|~<~) # string comparison for pattern matching operator families
+                |
+                (?:!~~|!~~\*|~~\*|~~) # LIKE operators
+                |
+                (?:!~\*|!~|~\*) # regular expression operators
+                |
+                (?:\*=|\*<>|\*<=|\*>=|\*<|\*>) # composite type comparison operators
+                |
+                (?:<>|<=>|>=|<=|==|=|!=|!|<<|>>|<|>|\|\||\||&&|&|-|\+|\*(?!/)|/(?!\*)|\%|~|\^|\?) # operators and tests
+                |
+                [\[\]\(\),;.]            # punctuation (parenthesis, comma)
+                |
+                \'\'(?!\')              # empty single quoted string
+                |
+                \"\"(?!\"")             # empty double quoted string
+                |
+                "(?>(?:(?>[^"\\]+)|""|\\.)*)+" # anything inside double quotes, ungreedy
+                |
+                `(?>(?:(?>[^`\\]+)|``|\\.)*)+` # anything inside backticks quotes, ungreedy
+                |
+                '(?>(?:(?>[^'\\]+)|''|\\.)*)+' # anything inside single quotes, ungreedy.
+                |
+                /\*[\ \t\r\n\S]*?\*/      # C style comments
+                |
+                (?:[\w:@]+(?:\.(?:\w+|\*)?)*) # words, standard named placeholders, db.table.*, db.*
+                |
+                (?:\$\w+\$)
+                |
+                (?: \$_\$ | \$\d+ | \${1,2} | \$\w+\$ ) # dollar expressions - eg $_$ $3 $$ $BODY$
+                |
+                \n                      # newline
+                |
+                [\t\ ]+                 # any kind of white spaces
+        )
 }smx;
 
                my @query = ();