Make autovacuum report the start time of its current activity in
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 23 Sep 2007 20:07:33 +0000 (20:07 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 23 Sep 2007 20:07:33 +0000 (20:07 +0000)
pg_stat_activity.  Per gripe from Jim Nasby.

src/backend/postmaster/autovacuum.c

index d653167fc91396c754ec35ab0a73fa3df0bdb745..583df2172ab87067649a199e2802b692fe8daaa8 100644 (file)
@@ -2576,7 +2576,7 @@ autovacuum_do_vac_analyze(Oid relid, bool dovacuum, bool doanalyze,
  * equivalent command was to be issued manually.
  *
  * Note we assume that we are going to report the next command as soon as we're
- * done with the current one, and exiting right after the last one, so we don't
+ * done with the current one, and exit right after the last one, so we don't
  * bother to report "<IDLE>" or some such.
  */
 static void
@@ -2611,6 +2611,9 @@ autovac_report_activity(VacuumStmt *vacstmt, Oid relid)
                                 " %s.%s", nspname, relname);
        }
 
+       /* Set statement_timestamp() to current time for pg_stat_activity */
+       SetCurrentStatementStartTimestamp();
+
        pgstat_report_activity(activity);
 }