Re: Remove trailing newlines from pg_upgrade's messages

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Remove trailing newlines from pg_upgrade's messages
Дата
Msg-id 1736968.1657654903@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Remove trailing newlines from pg_upgrade's messages  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
> On 14.06.22 20:57, Tom Lane wrote:
>> Hence, the patch below removes trailing newlines from all of
>> pg_upgrade's message strings, and teaches its logging infrastructure
>> to print them where appropriate.  As in logging.c, there's now an
>> Assert that no format string passed to pg_log() et al ends with
>> a newline.

> This patch looks okay to me.  I compared the output before and after in 
> a few scenarios and didn't see any problematic differences.

Thanks, pushed after rebasing and adjusting some recently-added messages.

> In this particular patch, the few empty lines that disappeared don't 
> bother me.  In general, however, I think we can just fprintf(stderr, 
> "\n") directly as necessary.

Hmm, if anyone wants to do that I think it'd be advisable to invent
"pg_log_blank_line()" or something like that, so as to preserve the
logging abstraction layer.  But it's moot unless anyone's interested
enough to send a patch for that.  I'm not.

(I think it *would* be a good idea to try to get rid of the leading
newlines that appear in some of the messages, as discussed upthread.
But I'm not going to trouble over that right now either.)

            regards, tom lane



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

Предыдущее
От: Juan José Santamaría Flecha
Дата:
Сообщение: Re: WIN32 pg_import_system_collations
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Remove trailing newlines from pg_upgrade's messages