1. Norbert Melzer
  2. pygments-main


Daniele Varrazzo  committed a2bde5e

Parse CONTEXT in Postgres output

  • Participants
  • Parent commits bbfc82d
  • Branches default

Comments (0)

Files changed (2)

File pygments/lexers/postgres.py

View file
  • Ignore whitespace
 re_error = re.compile(r'(ERROR|FATAL):')
 re_message = re.compile(
-    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

View file
  • Ignore whitespace
 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