Re: log_min_messages per backend type

Поиск
Список
Период
Сортировка
От Euler Taveira
Тема Re: log_min_messages per backend type
Дата
Msg-id 24b9bfd6-7fba-4946-9b73-244934b89464@app.fastmail.com
обсуждение исходный текст
Ответ на Re: log_min_messages per backend type  (Japin Li <japinli@hotmail.com>)
Список pgsql-hackers
On Thu, Jul 31, 2025, at 8:34 PM, Japin Li wrote:
> On Thu, 31 Jul 2025 at 18:51, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>> On 2025-Aug-01, Japin Li wrote:
>>
>>> If we set the log level for all backend types, I don't think a generic log
>>> level is necessary.
>>
>> I don't understand what you mean by this.  Can you elaborate?
>>
> For example:
>
> ALTER SYSTEM SET log_min_messages TO
> 'archiver:info, autovacuum:info, backend:info, bgworker:info, 
> bgwriter:info, checkpointer:info, ioworker:info, logger:info, 
> slotsyncworker:info, startup:info, walreceiver:info, walsender:info, 
> walsummarizer:info, walwriter:info';
>
> Given that we've set a log level for every backend type and
> assigned[BACKEND_NUM_TYPES] is true, a generic level seems redundant.
>

The main reason I didn't consider this idea was that this GUC assignment will
fail as soon as a new backend type is added. Restore a dump should work
across major versions.

> I think we can avoid memory allocation by using pg_strncasecmp().
>

loglevel does not required a memory allocation but I didn't include the btype
part because it complicates the error message that uses btype a few lines
above.

This new patch contains the following changes:

- patch was rebased
- use commit dbf8cfb4f02
- use some GUC memory allocation functions
- avoid one memory allocation (suggested by Japin Li)
- rename backend type: logger -> syslogger
- adjust tests to increase test coverage
- improve documentation and comments to reflect the current state


-- 
Euler Taveira
EDB   https://www.enterprisedb.com/
Вложения

В списке pgsql-hackers по дате отправления: