Add background worker type
Peter Eisentraut <peter_e@gmx.net>
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 <michael.paquier@gmail.com> Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_prewarm/autoprewarm.c | modified | +4 −2 |
| doc/src/sgml/bgworker.sgml | modified | +9 −2 |
| src/backend/access/transam/parallel.c | modified | +1 −0 |
| src/backend/postmaster/bgworker.c | modified | +47 −4 |
| src/backend/postmaster/postmaster.c | modified | +3 −2 |
| src/backend/replication/logical/launcher.c | modified | +3 −0 |
| src/backend/utils/adt/pgstatfuncs.c | modified | +14 −2 |
| src/include/postmaster/bgworker.h | modified | +2 −0 |
| src/test/modules/test_shm_mq/setup.c | modified | +1 −1 |
| src/test/modules/worker_spi/worker_spi.c | modified | +5 −3 |