Unify several ways to tracking backend type
Peter Eisentraut <peter@eisentraut.org>
Unify several ways to tracking backend type Add a new global variable MyBackendType that uses the same BackendType enum that was previously only used by the stats collector. That way several duplicate ways of checking what type a particular process is can be simplified. Since it's no longer just for stats, move to miscinit.c and rename existing functions to match the expanded purpose. Reviewed-by: Julien Rouhaud <rjuju123@gmail.com> Reviewed-by: Kuntal Ghosh <kuntalghosh.2007@gmail.com> Reviewed-by: Alvaro Herrera <alvherre@2ndquadrant.com> Discussion: https://www.postgresql.org/message-id/flat/c65e5196-4f04-4ead-9353-6088c19615a3@2ndquadrant.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/bootstrap/bootstrap.c | modified | +20 −28 |
| src/backend/postmaster/autovacuum.c | modified | +4 −4 |
| src/backend/postmaster/bgworker.c | modified | +1 −1 |
| src/backend/postmaster/pgarch.c | modified | +2 −4 |
| src/backend/postmaster/pgstat.c | modified | +3 −102 |
| src/backend/postmaster/postmaster.c | modified | +6 −1 |
| src/backend/postmaster/syslogger.c | modified | +2 −1 |
| src/backend/utils/adt/pgstatfuncs.c | modified | +1 −1 |
| src/backend/utils/init/miscinit.c | modified | +55 −0 |
| src/backend/utils/misc/ps_status.c | modified | +9 −2 |
| src/include/miscadmin.h | modified | +22 −0 |
| src/include/pgstat.h | modified | +1 −20 |
Discussion
- backend type in log_line_prefix? 26 messages · 2020-02-13 → 2020-04-01