Re: [COMMITTERS] pgsql: Mark JSON error detail messages for translation.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [COMMITTERS] pgsql: Mark JSON error detail messages for translation.
Дата
Msg-id 14578.1339613724@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [COMMITTERS] pgsql: Mark JSON error detail messages for translation.  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Jun 13, 2012 at 1:04 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Robert Haas <robertmhaas@gmail.com> writes:
>>> ! DETAIL:  Character with value 0x0a must be escaped.
>>> ! CONTEXT:  JSON data, line 1: "abc
>>> ! ...
>>> 
>>> This seems an odd way to present this, especially if the goal is to
>>> NOT include the character needing escaping in the log unescaped, which
>>> I thought was the point of saying 0x0a.

>> Do you think it would be better to present something that isn't what the
>> user typed?  Again, I don't see an easy improvement here.  If you don't
>> want newlines in the logged context, what will we do for something like
>> 
>>        {"foo": {
>>                "bar":44
>>                }
>>        ]

> Hmm.  If your plan is to trace back to the opening brace you were
> expecting to match, I don't think that's going to work either.  What
> if there are three pages (or 3MB) of data in between?

No, that's not the proposal; I only anticipate printing a few dozen
characters of context.  But that could still mean printing something
like
DETAIL:  expected "," or "}", but found "]".CONTEXT:  JSON data, line 123: ..."bar":44              }       ]

which I argue is much more useful than just seeing the "]".  So the
question is whether it's still as useful if we mangle the whitespace.
I'm thinking it's not.  We don't mangle whitespace when printing SQL
statements into the log, anyway.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Christopher Browne
Дата:
Сообщение: Re: [PATCH 14/16] Add module to apply changes from an apply-cache using low-level functions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Add ERROR msg for GLOBAL/LOCAL TEMP is not yet implemented