Re: Remove trailing newlines from pg_upgrade's messages

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Remove trailing newlines from pg_upgrade's messages
Date: 2022-07-12 05:21:14
Message-ID: 1afc8f90-d795-c654-91e6-f58793ff3c01@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2022-07-12 05:34:57 Re: Reducing Memory Consumption (aset and generation)
Previous Message David Rowley 2022-07-12 05:15:08 Re: PG15 beta1 sort performance regression due to Generation context change