From: Simon Riggs Date: Mon, 12 Sep 2016 07:57:14 +0000 (+0100) Subject: Identify walsenders in pg_stat_activity X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=fc3d4a44e9375f79709f470cb3c83d4ca28fb370;p=users%2Fheikki%2Fpostgres.git Identify walsenders in pg_stat_activity Following 8299471c37fff0b walsender procs are now visible in pg_stat_activity. Set query to ‘walsender’ for walsender procs to allow them to be identified. Discussion:CAB7nPqS8c76KPSufK_HSDeYrbtg+zZ7D0EEkjeM6txSEuCB_jA@mail.gmail.com Michael Paquier, issue raised by Fujii Masao, reviewed by Tom Lane --- diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 1ea2a5cfdf..c7743da034 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -1806,6 +1806,9 @@ WalSndLoop(WalSndSendDataCallback send_data) last_reply_timestamp = GetCurrentTimestamp(); waiting_for_ping_response = false; + /* Report to pgstat that this process is a WAL sender */ + pgstat_report_activity(STATE_RUNNING, "walsender"); + /* * Loop until we reach the end of this timeline or the client requests to * stop streaming.