diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-07-12 15:17:44 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-07-12 15:17:44 -0400 |
commit | 7652353d87a6753627a6b6b36d7acd68475ea7c7 (patch) | |
tree | 94bd184f423b5fded9d3e2d700568e16353fb12e /src/backend/parser/parse_expr.c | |
parent | eea9fa9b250f4044aa35d537f234c7d44fa9db3d (diff) | |
download | postgresql-7652353d87a6753627a6b6b36d7acd68475ea7c7.tar.gz postgresql-7652353d87a6753627a6b6b36d7acd68475ea7c7.zip |
Remove trailing newlines in pg_upgrade's message strings.
pg_upgrade does not use common/logging.c, which is unfortunate
but changing it to do so seems like more work than is justified.
However, we really need to make it work more like common/logging.c
in one respect: the latter expects supplied message strings to not
end with a newline, instead adding one internally. As it stands,
pg_upgrade's logging facilities expect a caller-supplied newline
in some cases and not others, which is already an invitation to bugs,
but the inconsistency with our other frontend code makes it worse.
There are already several places with missing or extra newlines,
and it's inevitable that there won't be more if we let this stand.
Hence, run around and get rid of all trailing newlines in message
strings, and add an Assert that there's not one, similar to the
existing Assert in common/logging.c. Adjust the logging functions
to supply a newline at the right places.
(Some of these strings also have a *leading* newline, which would
be a good thing to get rid of too; but this patch doesn't attempt
that.)
There are some consequent minor changes in output. The ones that
aren't outright bug fixes are generally removal of extra blank
lines that the original coding intentionally inserted. It didn't
seem worth being bug-compatible with that.
Patch by me, reviewed by Kyotaro Horiguchi and Peter Eisentraut
Discussion: https://postgr.es/m/113191.1655233060@sss.pgh.pa.us
Diffstat (limited to 'src/backend/parser/parse_expr.c')
0 files changed, 0 insertions, 0 deletions