pg_autovacuum micro patch to display database name when ANALYZEing or VACUUMing tables - Mailing list pgsql-patches

From Cosimo Streppone
Subject pg_autovacuum micro patch to display database name when ANALYZEing or VACUUMing tables
Date
Msg-id 423ABE45.5010607@streppone.it
Whole thread Raw
Responses Re: pg_autovacuum micro patch to display database name when  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Here it is,

a small tweak to enable display in the log file
of database name before table name
when VACUUMing or ANALYZing a table.


--
Cosimo
--- postgresql-8.0.1/contrib/pg_autovacuum/pg_autovacuum.c.orig    Fri Mar 18 12:03:54 2005
+++ postgresql-8.0.1/contrib/pg_autovacuum/pg_autovacuum.c    Fri Mar 18 12:04:03 2005
@@ -1049,9 +1049,9 @@
      */
     if ((tbl->relisshared > 0 && strcmp("template1", dbi->dbname) != 0) ||
         (operation == ANALYZE_ONLY))
-        snprintf(buf, sizeof(buf), "ANALYZE %s", tbl->table_name);
+        snprintf(buf, sizeof(buf), "ANALYZE %s.%s", dbi->dbname, tbl->table_name);
     else if (operation == VACUUM_ANALYZE)
-        snprintf(buf, sizeof(buf), "VACUUM ANALYZE %s", tbl->table_name);
+        snprintf(buf, sizeof(buf), "VACUUM ANALYZE %s.%s", dbi->dbname, tbl->table_name);
     else
         return;


pgsql-patches by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Another kerberos patch
Next
From: a_ogawa
Date:
Subject: Re: WIP: avoiding tuple construction/deconstruction overhead