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: 2026-02-11 05:21:56
Message-ID: 396CA546-7368-426C-B047-492564707ACB@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Feb 11, 2026, at 06:05, Euler Taveira <euler(at)eulerto(dot)com> wrote:
>
> On Mon, Feb 9, 2026, at 10:03 AM, Alvaro Herrera wrote:
>> On 2026-Feb-09, Alvaro Herrera wrote:
>>
>>> I just pushed this, and somehow I forgot to squash this into the commit.
>>> I don't think it matters terribly much though, so I'm going to hang onto
>>> this for a while in case some bug is found.
>>
>> Euler mentioned offlist that I also forgot to remove
>> log_min_messages_process_types from guc.h. So that gives us this patch
>> for now.
>>
>
> I expanded this patch a bit with fixes proposed by Man Zeng and Noriyoshi
> Shinoda. Besides these changes, I noticed that
>
> * default value in uppercase: since we changed the vartype from enum to string
> and enum maps DEBUG1 to "debug1" (see server_message_level_options), it
> should use the lowercase string to keep the same output as previous versions.
> There is no bug here. It is just a matter of keeping the same output.
> * use single quote: since we changed the vartype from enum to string, we should
> add single quotes. If you don't add single quotes, it works (for a single
> default log level) -- as exercised in the tests. However, as soon as the user
> adds an extra element it fails. This avoids confusion.
>
> $ psql
> psql (19devel)
> Type "help" for help.
>
> postgres=# show log_min_messages;
> log_min_messages
> ------------------
> WARNING
> (1 row)
>
> postgres=# set log_min_messages to debug1;
> SET
> postgres=# show log_min_messages;
> log_min_messages
> ------------------
> debug1
> (1 row)
>
> postgres=# set log_min_messages to 'debug1';
> SET
> postgres=# show log_min_messages;
> log_min_messages
> ------------------
> debug1
> (1 row)
>
> postgres=# set log_min_messages to warning, backend:error;
> ERROR: syntax error at or near ":"
> LINE 1: set log_min_messages to warning, backend:error;
> ^
> postgres=# set log_min_messages to 'warning, backend:error';
> SET
> postgres=# show log_min_messages;
> log_min_messages
> ------------------------
> warning, backend:error
> (1 row)
>
>
> --
> Euler Taveira
> EDB https://www.enterprisedb.com/<0001-Minor-cleanups-in-log_min_messages.patch>

This cleanup patch looks good to me.

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 Amit Kapila 2026-02-11 05:23:02 Re: [Patch] add new parameter to pg_replication_origin_session_setup
Previous Message shveta malik 2026-02-11 05:17:43 Re: Skipping schema changes in publication