summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-09-01 15:19:10 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-09-01 15:19:10 +0100
commit3271b375f38b1baeda54eb4809ec9404c34b01d4 (patch)
treecb07bc42583a3dcfdd0bf224150375a3ae522728
parent8e50a30370b1ad58d8ec308d5ee7d4e7d153bc4a (diff)
downloadpygments-3271b375f38b1baeda54eb4809ec9404c34b01d4.tar.gz
Parse CONTEXT in Postgres output
-rw-r--r--pygments/lexers/postgres.py2
-rw-r--r--tests/examplefiles/psql_session.txt1
2 files changed, 2 insertions, 1 deletions
diff --git a/pygments/lexers/postgres.py b/pygments/lexers/postgres.py
index 4c5bd007..902edd5b 100644
--- a/pygments/lexers/postgres.py
+++ b/pygments/lexers/postgres.py
@@ -231,7 +231,7 @@ re_psql_command = re.compile(r'(\s*)(\\.+?)(\s+)$')
re_error = re.compile(r'(ERROR|FATAL):')
re_message = re.compile(
r'((?:DEBUG|INFO|NOTICE|WARNING|ERROR|'
- r'FATAL|HINT|DETAIL|LINE [0-9]+):)(.*?\n)')
+ r'FATAL|HINT|DETAIL|CONTEXT|LINE [0-9]+):)(.*?\n)')
def lookahead(x):
"""Wrap an iterator and allow pushing back an item."""
diff --git a/tests/examplefiles/psql_session.txt b/tests/examplefiles/psql_session.txt
index fd87a133..7096072b 100644
--- a/tests/examplefiles/psql_session.txt
+++ b/tests/examplefiles/psql_session.txt
@@ -1,5 +1,6 @@
regression=# select foo;
ERROR: column "foo" does not exist
+CONTEXT: PL/pgSQL function "test1" while casting return value to function's return type
LINE 1: select foo;
^
regression=# \q