Commit 2d9d7a6b authored by Alvaro Herrera's avatar Alvaro Herrera

Avoid losing track of data for shared tables in pgstats. Report by Michael

Fuhr, patch from Tom Lane after a messier suggestion by me.
parent 04d919a1
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* *
* Copyright (c) 2001-2007, PostgreSQL Global Development Group * Copyright (c) 2001-2007, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.158 2007/05/27 17:28:35 tgl Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.159 2007/06/07 18:53:17 alvherre Exp $
* ---------- * ----------
*/ */
#include "postgres.h" #include "postgres.h"
...@@ -813,7 +813,9 @@ pgstat_vacuum_tabstat(void) ...@@ -813,7 +813,9 @@ pgstat_vacuum_tabstat(void)
CHECK_FOR_INTERRUPTS(); CHECK_FOR_INTERRUPTS();
if (hash_search(htab, (void *) &dbid, HASH_FIND, NULL) == NULL) /* the DB entry for shared tables (with InvalidOid) is never dropped */
if (OidIsValid(dbid) &&
hash_search(htab, (void *) &dbid, HASH_FIND, NULL) == NULL)
pgstat_drop_database(dbid); pgstat_drop_database(dbid);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment