From d9eb92c7b122c4cf40e95ec45e88b27b318a2be9 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Wed, 26 Jul 2023 12:43:26 +0900 Subject: [PATCH] worker_spi: Use term "dynamic" for bgworkers launched with worker_spi_launch() This gives a way to make a difference between workers registered when the library is loaded with shared_preload_libraries and when these are launched dynamically, in ps output or pg_stat_activity. Extracted from a larger patch by the same author. Author: Bharath Rupireddy Reviewed-by: Masahiro Ikeda Discussion: https://postgr.es/m/CALj2ACWR9ncAiDF73unqdJF1dmsA2R0efGXX2624X+YVxcAVWg@mail.gmail.com --- src/test/modules/worker_spi/worker_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/modules/worker_spi/worker_spi.c b/src/test/modules/worker_spi/worker_spi.c index ada0fb8ac73..903dcddef97 100644 --- a/src/test/modules/worker_spi/worker_spi.c +++ b/src/test/modules/worker_spi/worker_spi.c @@ -370,8 +370,8 @@ worker_spi_launch(PG_FUNCTION_ARGS) worker.bgw_restart_time = BGW_NEVER_RESTART; sprintf(worker.bgw_library_name, "worker_spi"); sprintf(worker.bgw_function_name, "worker_spi_main"); - snprintf(worker.bgw_name, BGW_MAXLEN, "worker_spi worker %d", i); - snprintf(worker.bgw_type, BGW_MAXLEN, "worker_spi"); + snprintf(worker.bgw_name, BGW_MAXLEN, "worker_spi dynamic worker %d", i); + snprintf(worker.bgw_type, BGW_MAXLEN, "worker_spi dynamic"); worker.bgw_main_arg = Int32GetDatum(i); /* set bgw_notify_pid so that we can use WaitForBackgroundWorkerStartup */ worker.bgw_notify_pid = MyProcPid; -- 2.39.5