Commits

Daniele Varrazzo  committed a2bde5e

Parse CONTEXT in Postgres output

  • Participants
  • Parent commits bbfc82d

Comments (0)

Files changed (2)

File pygments/lexers/postgres.py

 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."""

File tests/examplefiles/psql_session.txt

 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