Re: log_min_messages per backend type

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Euler Taveira <euler(at)eulerto(dot)com>
Cc: japin <japinli(at)hotmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Subject: Re: log_min_messages per backend type
Date: 2026-01-20 15:43:48
Message-ID: 202601201541.hbzj6ihp7ei4@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2026-Jan-15, Euler Taveira wrote:

> 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.

Thanks! Pushed.

> 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.

Good catch, thanks.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Digital and video cameras have this adjustment and film cameras don't for the
same reason dogs and cats lick themselves: because they can." (Ken Rockwell)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2026-01-20 15:47:04 Re: Change copyObject() to use typeof_unqual
Previous Message Antonin Houska 2026-01-20 15:39:10 Re: Adding REPACK [concurrently]