Re: refactor backend type lists
Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>
From: Jonathan Abdiel Gonzalez Valdebenito <jonathan.abdiel@gmail.com>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Euler Taveira <euler@eulerto.com>,
Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-09-18T09:56:38Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Create a separate file listing backend types
- dbf8cfb4f02e 19 (unreleased) landed
-
Replace postmaster.c's own backend type codes with BackendType
- 18d67a8d7d30 18.0 cited
Attachments
- v3-0001-Create-a-separate-file-listing-backend-types.patch (text/x-patch) patch v3-0001
- v3-0003-Make-translation-compatible.patch (text/x-patch) patch v3-0003
- v3-0002-LogChildExit-HandleChildCrash-support.patch (text/x-patch) patch v3-0002
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,