Re: Quoting filename in using facing log messages
От | Daniel Gustafsson |
---|---|
Тема | Re: Quoting filename in using facing log messages |
Дата | |
Msg-id | EFFD4A1E-73A4-4616-9CC5-84FA25399F6F@yesql.se обсуждение исходный текст |
Ответ на | Re: Quoting filename in using facing log messages (Peter Eisentraut <peter@eisentraut.org>) |
Ответы |
Re: Quoting filename in using facing log messages
|
Список | pgsql-hackers |
> On 13 Sep 2023, at 13:55, Peter Eisentraut <peter@eisentraut.org> wrote: > > On 13.09.23 13:48, Daniel Gustafsson wrote: >> Looking at ZQFUGOuS5DU4DsE4@paquier.xyz I noticed that we had a a few instances >> of filenames in userfacing log messages (ie not elog or DEBUGx etc) not being >> quoted, where the vast majority are quoted like \"%s\". Any reason not to >> quote them as per the attached to be consistent across all log messages? > > Since WAL file names have a predictable format, there is less pressure to quote them to avoid ambiguities. But in generalwe should try to be consistent Correct, this is all for consistency. > so your patch makes sense to me. Thanks! It might be worth concatenating the errmsg() while there since we typically don't linebreak errmsg strings anymore for greppability: - errmsg("could not write to log file %s " - "at offset %u, length %zu: %m", + errmsg("could not write to log file \"%s\" at offset %u, length %zu: %m", I don't have strong feelings wrt that, just have a vague memory of "concatenate when touching" as an informal guideline. -- Daniel Gustafsson
В списке pgsql-hackers по дате отправления: