From: Euler Taveira <euler@eulerto.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: japin <japinli@hotmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org, "Chao Li" <li.evan.chao@gmail.com>
Subject: Re: log_min_messages per backend type
Date: Thu, 15 Jan 2026 10:50:00 -0300
Message-ID: <603d4e3e-8aa1-485f-8f0c-3f48822fbf9c@app.fastmail.com> (raw)
In-Reply-To: <202512090935.k3xrtr44hxkn@alvherre.pgsql>
References: <202512090935.k3xrtr44hxkn@alvherre.pgsql>
On Tue, Dec 9, 2025, at 1:30 PM, Alvaro Herrera wrote:
> BTW another thing I realized while looking this over, is that we quite
> uselessly transform the integer backend type to a string, pass it as a
> string using the --forkchild= argument to the child process, then parse
> the string back to an int to use as an array index. It would be much
> easier to just use the integer value everywhere, as the attached shows.
>
It is a good simplification. There is just one oversight.
+ child_type = (BackendType) atoi(child_kind);
+ if (child_type <= B_INVALID || child_type > BACKEND_NUM_TYPES)
elog(ERROR, "unknown child kind %s", child_kind);
It should be BACKEND_NUM_TYPES - 1.
--
Euler Taveira
EDB https://www.enterprisedb.com/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: euler@eulerto.com, alvherre@alvh.no-ip.org, japinli@hotmail.com, andres@anarazel.de, li.evan.chao@gmail.com
Subject: Re: log_min_messages per backend type
In-Reply-To: <603d4e3e-8aa1-485f-8f0c-3f48822fbf9c@app.fastmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox