Re: refactor backend type lists - Mailing list pgsql-hackers

From Jonathan Abdiel Gonzalez Valdebenito
Subject Re: refactor backend type lists
Date
Msg-id CALE5RAsHr4ms3y0oqcFHROETfGOdav-5DqpeURwQ8Y_VrsNFAQ@mail.gmail.com
Whole thread Raw
In response to Re: refactor backend type lists  (Álvaro Herrera <alvherre@kurilemu.de>)
List pgsql-hackers
On Thu, Sep 18, 2025 at 11:33 AM Álvaro Herrera <alvherre@kurilemu.de> wrote:

> > I'm not sure if it is a good idea to have translated backend description. The
> > init_ps_display() output is certainly used to obtain information (PID?) from a
> > process list. There is also the option %b from log_line_prefix that is used to
> > filter log messages per backend type. The same applies to backend_type column
> > from pg_stat_activity view.
>
> I should have let you know that I spent some time on this today as well
> to avoid duplicating efforts.  Here are my patches, incorporating your
> fixup -- I hadn't looked at your 0004 yet, so I wrote it differently,
> passing the BackendType enum directly to LogChildExit (as well as
> HandleChildCrash), so it is the former function that does the call to
> GetBackendTypeDesc() to obtain the string.  I think this is better
> because the untranslated part of the sentence is enclosed in quotes,
> which I think is better.  However it meant I had to add a bit of a hack
> to cope with the background worker separate bgw_type string.
>
> So I came up with things as attached, incorporating your 0003 fixup.
> What do you think?
>

The call to gettext_noop() was missing, hence, the translation for the
backends was
missing. I've attached a third commit to your patch adding the missing
gettext_noop()
and also adding the include directory to the nls.mk Makefile which
will add proctypelist.h
to the list of files used to generate the po.

I've tested the patch using `make -C src/backend update-po` and the
strings were added
properly.

Regards,

Attachment

pgsql-hackers by date:

Previous
From: Frédéric Yhuel
Date:
Subject: Re: [BUG] temporary file usage report with extended protocol and unnamed portals
Next
From: Peter Eisentraut
Date:
Subject: _CRT_glob stuff