slightly confusing JSON error context - Mailing list pgsql-hackers

From Peter Eisentraut
Subject slightly confusing JSON error context
Date
Msg-id 1371691158.13762.35.camel@vanquo.pezone.net
Whole thread Raw
Responses Re: slightly confusing JSON error context
List pgsql-hackers
These are some cases from the regression tests:

SELECT ''::json;                -- ERROR, no value
ERROR:  invalid input syntax for type json
LINE 1: SELECT ''::json;              ^
DETAIL:  The input string ended unexpectedly.
CONTEXT:  JSON data, line 1: 

SELECT '    '::json;            -- ERROR, no value
ERROR:  invalid input syntax for type json
LINE 1: SELECT '    '::json;              ^
DETAIL:  The input string ended unexpectedly.
CONTEXT:  JSON data, line 1:     

Perhaps we should either put some quotes around the whitespace at the
end of the CONTEXT lines, or write something like "end of input".
Otherwise this might look weird.  There might be more complicated cases
where it looks even weirder.






pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: event trigger API documentation?
Next
From: Tatsuo Ishii
Date:
Subject: Re: Implementing incremental backup