Re: log_min_messages per backend type

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Euler Taveira <euler(at)eulerto(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, japin <japinli(at)hotmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: log_min_messages per backend type
Date: 2025-12-11 02:11:05
Message-ID: 83347D77-0FD1-4A16-B026-013E0C9F2A4C@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Dec 11, 2025, at 09:57, Euler Taveira <euler(at)eulerto(dot)com> wrote:
>
>
>> In the “if” and “else” clauses, there are duplicate code to valid log
>> levels. We should refactor the code to avoid the duplication. For
>> example, pull up “loglevel” to the “for” loop level, then we can valid
>> it after the “if-else”.
>>
>
> The for loop is duplicate but if you create a separate function for it but the
> result is:
>
> src/backend/commands/variable.c | 43 ++++++++++++++++++++++---------------------
> 1 file changed, 22 insertions(+), 21 deletions(-)
>
>

I don’t think we need to add a separate function. We can use ‘if-else” to parse log level, then verify it after “if-else”.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2025-12-11 02:21:39 Re: index prefetching
Previous Message Ioseph Kim 2025-12-11 01:59:49 Re: Propose: Adding a '--enable-failover' option to 'pg_createsubscriber'