initStringInfo(&reply_message);
initStringInfo(&tmpbuf);
+ /* Report to pgstat that this process is running */
+ pgstat_report_activity(STATE_RUNNING, NULL);
+
switch (cmd_node->type)
{
case T_IdentifySystemCmd:
ereport(ERROR,
(errmsg("cannot execute SQL commands in WAL sender for physical replication")));
+ /* Report to pgstat that this process is now idle */
+ pgstat_report_activity(STATE_IDLE, NULL);
+
/* Tell the caller that this wasn't a WalSender command. */
return false;
/* Send CommandComplete message */
EndCommand("SELECT", DestRemote);
+ /* Report to pgstat that this process is now idle */
+ pgstat_report_activity(STATE_IDLE, NULL);
+
return true;
}
last_reply_timestamp = GetCurrentTimestamp();
waiting_for_ping_response = false;
- /* Report to pgstat that this process is running */
- pgstat_report_activity(STATE_RUNNING, NULL);
-
/*
* Loop until we reach the end of this timeline or the client requests to
* stop streaming.