Re: refactor backend type lists

From: Jonathan Abdiel Gonzalez Valdebenito <jonathan(dot)abdiel(at)gmail(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: Euler Taveira <euler(at)eulerto(dot)com>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: refactor backend type lists
Date: 2025-09-18 09:56:38
Message-ID: CALE5RAsHr4ms3y0oqcFHROETfGOdav-5DqpeURwQ8Y_VrsNFAQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 18, 2025 at 11:33 AM Álvaro Herrera <alvherre(at)kurilemu(dot)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 Content-Type Size
v3-0001-Create-a-separate-file-listing-backend-types.patch text/x-patch 7.1 KB
v3-0003-Make-translation-compatible.patch text/x-patch 4.7 KB
v3-0002-LogChildExit-HandleChildCrash-support.patch text/x-patch 14.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2025-09-18 10:02:58 _CRT_glob stuff
Previous Message Frédéric Yhuel 2025-09-18 09:52:12 Re: [BUG] temporary file usage report with extended protocol and unnamed portals