summaryrefslogtreecommitdiff
path: root/src/backend/postmaster/launch_backend.c
diff options
context:
space:
mode:
authorÁlvaro Herrera <alvherre@kurilemu.de>2025-09-26 15:21:49 +0200
committerÁlvaro Herrera <alvherre@kurilemu.de>2025-09-26 15:21:49 +0200
commitdbf8cfb4f02eb9ec5525de1761675f9babfd30e3 (patch)
tree7bb306ce314cf262c6bb54473bc7571d9cab1d4b /src/backend/postmaster/launch_backend.c
parent8bb174295e8920fe202e2fb4c8d271e4546b9e98 (diff)
Create a separate file listing backend types
Use our established coding pattern to reduce maintenance pain when adding other per-process-type characteristics. Like PG_KEYWORD, PG_CMDTAG, PG_RMGR. To keep the strings translatable, the relevant makefile now also scans src/include for this specific file. I didn't want to have it scan all .h files, as then gettext would have to scan all header files. I didn't find any way to affect the meson behavior in this respect though. Author: Álvaro Herrera <alvherre@kurilemu.de> Co-authored-by: Jonathan Gonzalez V. <jonathan.abdiel@gmail.com> Discussion: https://postgr.es/m/202507151830.dwgz5nmmqtdy@alvherre.pgsql
Diffstat (limited to 'src/backend/postmaster/launch_backend.c')
-rw-r--r--src/backend/postmaster/launch_backend.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/src/backend/postmaster/launch_backend.c b/src/backend/postmaster/launch_backend.c
index 79708e59259..976638a58ac 100644
--- a/src/backend/postmaster/launch_backend.c
+++ b/src/backend/postmaster/launch_backend.c
@@ -179,34 +179,10 @@ typedef struct
} child_process_kind;
static child_process_kind child_process_kinds[] = {
- [B_INVALID] = {"invalid", NULL, false},
-
- [B_BACKEND] = {"backend", BackendMain, true},
- [B_DEAD_END_BACKEND] = {"dead-end backend", BackendMain, true},
- [B_AUTOVAC_LAUNCHER] = {"autovacuum launcher", AutoVacLauncherMain, true},
- [B_AUTOVAC_WORKER] = {"autovacuum worker", AutoVacWorkerMain, true},
- [B_BG_WORKER] = {"bgworker", BackgroundWorkerMain, true},
-
- /*
- * WAL senders start their life as regular backend processes, and change
- * their type after authenticating the client for replication. We list it
- * here for PostmasterChildName() but cannot launch them directly.
- */
- [B_WAL_SENDER] = {"wal sender", NULL, true},
- [B_SLOTSYNC_WORKER] = {"slot sync worker", ReplSlotSyncWorkerMain, true},
-
- [B_STANDALONE_BACKEND] = {"standalone backend", NULL, false},
-
- [B_ARCHIVER] = {"archiver", PgArchiverMain, true},
- [B_BG_WRITER] = {"bgwriter", BackgroundWriterMain, true},
- [B_CHECKPOINTER] = {"checkpointer", CheckpointerMain, true},
- [B_IO_WORKER] = {"io_worker", IoWorkerMain, true},
- [B_STARTUP] = {"startup", StartupProcessMain, true},
- [B_WAL_RECEIVER] = {"wal_receiver", WalReceiverMain, true},
- [B_WAL_SUMMARIZER] = {"wal_summarizer", WalSummarizerMain, true},
- [B_WAL_WRITER] = {"wal_writer", WalWriterMain, true},
-
- [B_LOGGER] = {"syslogger", SysLoggerMain, false},
+#define PG_PROCTYPE(bktype, description, main_func, shmem_attach) \
+ [bktype] = {description, main_func, shmem_attach},
+#include "postmaster/proctypelist.h"
+#undef PG_PROCTYPE
};
const char *