Commit be87b70b authored by Peter Eisentraut's avatar Peter Eisentraut

Sync process names between ps and pg_stat_activity

Remove gratuitous differences in the process names shown in
pg_stat_activity.backend_type and the ps output.
Reviewed-by: default avatarTakayuki Tsunakawa <tsunakawa.takay@jp.fujitsu.com>
parent 2c74e6c1
...@@ -49,11 +49,11 @@ ...@@ -49,11 +49,11 @@
<screen> <screen>
$ ps auxww | grep ^postgres $ ps auxww | grep ^postgres
postgres 15551 0.0 0.1 57536 7132 pts/0 S 18:02 0:00 postgres -i postgres 15551 0.0 0.1 57536 7132 pts/0 S 18:02 0:00 postgres -i
postgres 15554 0.0 0.0 57536 1184 ? Ss 18:02 0:00 postgres: writer process postgres 15554 0.0 0.0 57536 1184 ? Ss 18:02 0:00 postgres: background writer
postgres 15555 0.0 0.0 57536 916 ? Ss 18:02 0:00 postgres: checkpointer process postgres 15555 0.0 0.0 57536 916 ? Ss 18:02 0:00 postgres: checkpointer
postgres 15556 0.0 0.0 57536 916 ? Ss 18:02 0:00 postgres: wal writer process postgres 15556 0.0 0.0 57536 916 ? Ss 18:02 0:00 postgres: walwriter
postgres 15557 0.0 0.0 58504 2244 ? Ss 18:02 0:00 postgres: autovacuum launcher process postgres 15557 0.0 0.0 58504 2244 ? Ss 18:02 0:00 postgres: autovacuum launcher
postgres 15558 0.0 0.0 17512 1068 ? Ss 18:02 0:00 postgres: stats collector process postgres 15558 0.0 0.0 17512 1068 ? Ss 18:02 0:00 postgres: stats collector
postgres 15582 0.0 0.0 58772 3080 ? Ss 18:04 0:00 postgres: joe runbug 127.0.0.1 idle postgres 15582 0.0 0.0 58772 3080 ? Ss 18:04 0:00 postgres: joe runbug 127.0.0.1 idle
postgres 15606 0.0 0.0 58772 3052 ? Ss 18:07 0:00 postgres: tgl regression [local] SELECT waiting postgres 15606 0.0 0.0 58772 3052 ? Ss 18:07 0:00 postgres: tgl regression [local] SELECT waiting
postgres 15610 0.0 0.0 58772 3056 ? Ss 18:07 0:00 postgres: tgl regression [local] idle in transaction postgres 15610 0.0 0.0 58772 3056 ? Ss 18:07 0:00 postgres: tgl regression [local] idle in transaction
...@@ -102,7 +102,7 @@ $ psql -c 'SHOW cluster_name' ...@@ -102,7 +102,7 @@ $ psql -c 'SHOW cluster_name'
(1 row) (1 row)
$ ps aux|grep server1 $ ps aux|grep server1
postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: server1: writer process postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: server1: background writer
... ...
</screen> </screen>
</para> </para>
......
...@@ -321,19 +321,19 @@ AuxiliaryProcessMain(int argc, char *argv[]) ...@@ -321,19 +321,19 @@ AuxiliaryProcessMain(int argc, char *argv[])
switch (MyAuxProcType) switch (MyAuxProcType)
{ {
case StartupProcess: case StartupProcess:
statmsg = "startup process"; statmsg = pgstat_get_backend_desc(B_STARTUP);
break; break;
case BgWriterProcess: case BgWriterProcess:
statmsg = "writer process"; statmsg = pgstat_get_backend_desc(B_BG_WRITER);
break; break;
case CheckpointerProcess: case CheckpointerProcess:
statmsg = "checkpointer process"; statmsg = pgstat_get_backend_desc(B_CHECKPOINTER);
break; break;
case WalWriterProcess: case WalWriterProcess:
statmsg = "wal writer process"; statmsg = pgstat_get_backend_desc(B_WAL_WRITER);
break; break;
case WalReceiverProcess: case WalReceiverProcess:
statmsg = "wal receiver process"; statmsg = pgstat_get_backend_desc(B_WAL_RECEIVER);
break; break;
default: default:
statmsg = "??? process"; statmsg = "??? process";
......
...@@ -436,7 +436,7 @@ AutoVacLauncherMain(int argc, char *argv[]) ...@@ -436,7 +436,7 @@ AutoVacLauncherMain(int argc, char *argv[])
am_autovacuum_launcher = true; am_autovacuum_launcher = true;
/* Identify myself via ps */ /* Identify myself via ps */
init_ps_display("autovacuum launcher process", "", "", ""); init_ps_display(pgstat_get_backend_desc(B_AUTOVAC_LAUNCHER), "", "", "");
ereport(DEBUG1, ereport(DEBUG1,
(errmsg("autovacuum launcher started"))); (errmsg("autovacuum launcher started")));
...@@ -1519,7 +1519,7 @@ AutoVacWorkerMain(int argc, char *argv[]) ...@@ -1519,7 +1519,7 @@ AutoVacWorkerMain(int argc, char *argv[])
am_autovacuum_worker = true; am_autovacuum_worker = true;
/* Identify myself via ps */ /* Identify myself via ps */
init_ps_display("autovacuum worker process", "", "", ""); init_ps_display(pgstat_get_backend_desc(B_AUTOVAC_WORKER), "", "", "");
SetProcessingMode(InitProcessing); SetProcessingMode(InitProcessing);
......
...@@ -236,7 +236,7 @@ PgArchiverMain(int argc, char *argv[]) ...@@ -236,7 +236,7 @@ PgArchiverMain(int argc, char *argv[])
/* /*
* Identify myself via ps * Identify myself via ps
*/ */
init_ps_display("archiver process", "", "", ""); init_ps_display("archiver", "", "", "");
pgarch_MainLoop(); pgarch_MainLoop();
......
...@@ -4224,7 +4224,7 @@ PgstatCollectorMain(int argc, char *argv[]) ...@@ -4224,7 +4224,7 @@ PgstatCollectorMain(int argc, char *argv[])
/* /*
* Identify myself via ps * Identify myself via ps
*/ */
init_ps_display("stats collector process", "", "", ""); init_ps_display("stats collector", "", "", "");
/* /*
* Read in existing stats files or initialize the stats to zero. * Read in existing stats files or initialize the stats to zero.
......
...@@ -4266,14 +4266,14 @@ BackendInitialize(Port *port) ...@@ -4266,14 +4266,14 @@ BackendInitialize(Port *port)
* *
* For a walsender, the ps display is set in the following form: * For a walsender, the ps display is set in the following form:
* *
* postgres: wal sender process <user> <host> <activity> * postgres: walsender <user> <host> <activity>
* *
* To achieve that, we pass "wal sender process" as username and username * To achieve that, we pass "walsender" as username and username
* as dbname to init_ps_display(). XXX: should add a new variant of * as dbname to init_ps_display(). XXX: should add a new variant of
* init_ps_display() to avoid abusing the parameters like this. * init_ps_display() to avoid abusing the parameters like this.
*/ */
if (am_walsender) if (am_walsender)
init_ps_display("wal sender process", port->user_name, remote_ps_data, init_ps_display(pgstat_get_backend_desc(B_WAL_SENDER), port->user_name, remote_ps_data,
update_process_title ? "authentication" : ""); update_process_title ? "authentication" : "");
else else
init_ps_display(port->user_name, port->database_name, remote_ps_data, init_ps_display(port->user_name, port->database_name, remote_ps_data,
......
...@@ -173,7 +173,7 @@ SysLoggerMain(int argc, char *argv[]) ...@@ -173,7 +173,7 @@ SysLoggerMain(int argc, char *argv[])
am_syslogger = true; am_syslogger = true;
init_ps_display("logger process", "", "", ""); init_ps_display("logger", "", "", "");
/* /*
* If we restarted, our stderr is already redirected into our own input * If we restarted, our stderr is already redirected into our own input
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment