Re: Remove trailing newlines from pg_upgrade's messages - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Remove trailing newlines from pg_upgrade's messages
Date
Msg-id 1736968.1657654903@sss.pgh.pa.us
Whole thread Raw
In response to Re: Remove trailing newlines from pg_upgrade's messages  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
List 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 by date:

Previous
From: Juan José Santamaría Flecha
Date:
Subject: Re: WIN32 pg_import_system_collations
Next
From: Tom Lane
Date:
Subject: Re: Remove trailing newlines from pg_upgrade's messages