Re: Remove trailing newlines from pg_upgrade's messages

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Remove trailing newlines from pg_upgrade's messages
Дата
Msg-id 448817.1655308437@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Remove trailing newlines from pg_upgrade's messages  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы Re: Remove trailing newlines from pg_upgrade's messages  (Greg Stark <stark@mit.edu>)
Список pgsql-hackers
Kyotaro Horiguchi <horikyota.ntt@gmail.com> writes:
> Also leading newlines and just "\n" bug me when I edit message
> catalogues with poedit. I might want a line-spacing function like
> pg_log_newline(PG_REPORT) if we need line-breaks in the ends of a
> message.

Yeah, that is sort of the inverse problem.  I think those are there
to ensure that the text appears on a fresh line even if the current
line has transient status on it.  We could get rid of those perhaps
if we teach pg_log_v to remember whether it ended the last output
with a newline or not, and then put out a leading newline only if
necessary, rather than hard-wiring one into the message texts.

This might take a little bit of fiddling to make it work, because
we'd not want the extra newline when completing an incomplete line
by adding status.  That would mean that report_status would have
to do something special, plus we'd have to be sure that all such
cases do go through report_status rather than calling pg_log
directly.  (I'm fairly sure that the code is sloppy about that
today :-(.)  It seems probably do-able, though.

            regards, tom lane



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

Предыдущее
От: Álvaro Herrera
Дата:
Сообщение: Re: support for MERGE
Следующее
От: Robert Haas
Дата:
Сообщение: Re: better page-level checksums