pg_autovacuum micro patch to display database name when ANALYZEing or VACUUMing tables

Поиск
Список
Период
Сортировка
Искать

pg_autovacuum micro patch to display database name when ANALYZEing or VACUUMing tables

От:
Cosimo Streppone <cosimo@streppone.it>
Дата:
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;
 

Re: pg_autovacuum micro patch to display database name when

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:

Patch applied.  It will appear in 8.1.  Thanks.

---------------------------------------------------------------------------

Cosimo Streppone wrote:
> 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


> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
FAQ