slightly confusing JSON error context

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: slightly confusing JSON error context
Date: 2013-06-20 01:19:18
Message-ID: 1371691158.13762.35.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2013-06-20 01:25:21 Re: Implementing incremental backup
Previous Message Peter Eisentraut 2013-06-20 01:08:33 Re: event trigger API documentation?