Re: log_min_messages per backend type - Mailing list pgsql-hackers

From Euler Taveira
Subject Re: log_min_messages per backend type
Date
Msg-id 603d4e3e-8aa1-485f-8f0c-3f48822fbf9c@app.fastmail.com
Whole thread Raw
In response to Re: log_min_messages per backend type  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
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/



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Import Statistics in postgres_fdw before resorting to sampling.
Next
From: Andres Freund
Date:
Subject: Re: Add missing JIT inline pass for llvm>=17