* This is also a good time to send collected statistics to the
* collector, and to update the PS stats display. We avoid doing
* those every time through the message loop because it'd slow
- * down processing of batched messages.
+ * down processing of batched messages, and because we don't want
+ * to report uncommitted updates (that confuses autovacuum).
*/
if (send_rfq)
{
- pgstat_report_tabstat();
-
if (IsTransactionOrTransactionBlock())
{
set_ps_display("idle in transaction");
}
else
{
+ pgstat_report_tabstat();
+
set_ps_display("idle");
pgstat_report_activity("<IDLE>");
}