diff options
-rw-r--r-- | pygments/lexers/postgres.py | 2 | ||||
-rw-r--r-- | tests/examplefiles/psql_session.txt | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/pygments/lexers/postgres.py b/pygments/lexers/postgres.py index 79cfe3e1..f7c9dd0f 100644 --- a/pygments/lexers/postgres.py +++ b/pygments/lexers/postgres.py @@ -47,7 +47,7 @@ class PostgresLexer(RegexLexer): (r'([0-9]*\.[0-9]*|[0-9]+)(e[+-]?[0-9]+)?', Number.Float), (r'[0-9]+', Number.Integer), # TODO: Backslash escapes? - (r"'(''|[^'])*'", String.Single), + (r"E?'(''|[^'])*'", String.Single), (r'"(""|[^"])*"', String.Name), # quoted identifier (r'[a-zA-Z_][a-zA-Z0-9_]*', Name), diff --git a/tests/examplefiles/psql_session.txt b/tests/examplefiles/psql_session.txt index 8b920258..5a2897c6 100644 --- a/tests/examplefiles/psql_session.txt +++ b/tests/examplefiles/psql_session.txt @@ -14,6 +14,8 @@ HINT: Use the escape string syntax for escapes, e.g., E'\r\n'. x (1 row) +regression=# select E'\x'; + piro=> \set foo 30; piro=> select * from test where foo <= :foo; foo | bar |