Re: [COMMITTERS] pgsql: Mark JSON error detail messages for translation.
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2012-06-12T21:26:46Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Mark JSON error detail messages for translation.
- 36b7e3da17bc 9.2.0 cited
Alvaro Herrera <alvherre@commandprompt.com> writes: > I am not sure about the idea of letting the detail run to the end of the > line; that would be problematic should the line be long (there might not > be newlines in the literal at all, which is not that unusual). I think > it should be truncated at, say, 76 chars or so. Yeah, I was wondering about trying to provide a given amount of context instead of fixing it to "one line". We could do something like (1) back up N characters; (2) find the next newline, if there is one at least M characters before the error point; (3) print from there to the error point. This would give between M and N characters of context, except when the error point is less than M characters from the start of the input. Not sure how to display such text together with a line number though; with a multi-line fragment it would not be obvious which part the line number refers to. (Backing up over multibyte data might be a bit complicated too, but I assume we can think of something workable for that.) regards, tom lane