From 5373bc2a0867048bb78f93aede54ac1309b5e227 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 31 Aug 2017 12:24:47 -0400 Subject: Add background worker type Add bgw_type field to background worker structure. It is intended to be set to the same value for all workers of the same type, so they can be grouped in pg_stat_activity, for example. The backend_type column in pg_stat_activity now shows bgw_type for a background worker. The ps listing also no longer calls out that a process is a background worker but just show the bgw_type. That way, being a background worker is more of an implementation detail now that is not shown to the user. However, most log messages still refer to 'background worker "%s"'; otherwise constructing sensible and translatable log messages would become tricky. Reviewed-by: Michael Paquier Reviewed-by: Daniel Gustafsson --- src/backend/access/transam/parallel.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/backend/access/transam/parallel.c') diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c index 13c8ba3b196..c6f7b7af0e1 100644 --- a/src/backend/access/transam/parallel.c +++ b/src/backend/access/transam/parallel.c @@ -467,6 +467,7 @@ LaunchParallelWorkers(ParallelContext *pcxt) memset(&worker, 0, sizeof(worker)); snprintf(worker.bgw_name, BGW_MAXLEN, "parallel worker for PID %d", MyProcPid); + snprintf(worker.bgw_type, BGW_MAXLEN, "parallel worker"); worker.bgw_flags = BGWORKER_SHMEM_ACCESS | BGWORKER_BACKEND_DATABASE_CONNECTION | BGWORKER_CLASS_PARALLEL; -- cgit v1.2.3