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

From Peter Eisentraut
Subject Re: Remove trailing newlines from pg_upgrade's messages
Date
Msg-id 1afc8f90-d795-c654-91e6-f58793ff3c01@enterprisedb.com
Whole thread Raw
In response to Remove trailing newlines from pg_upgrade's messages  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Remove trailing newlines from pg_upgrade's messages
List pgsql-hackers
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.

> This doesn't quite exactly match the code's prior behavior.  Aside
> from the buggy-looking newlines mentioned above, there are a few
> messages that formerly ended with a double newline, thus intentionally
> producing a blank line, and now they don't.  I could have removed just
> one of their newlines, but I'd have had to give up the Assert about
> it, and I did not think that the extra blank lines were important
> enough to justify that.

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.



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: PG15 beta1 sort performance regression due to Generation context change
Next
From: David Rowley
Date:
Subject: Re: Reducing Memory Consumption (aset and generation)