From: Alvaro Herrera Date: Thu, 7 Jun 2007 19:07:13 +0000 (+0000) Subject: Avoid losing track of data for shared tables in pgstats. Report by Michael X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=037b398ce74fbf81a0c3fd6f951f1991250731a9;p=users%2Fbernd%2Fpostgres.git Avoid losing track of data for shared tables in pgstats. Report by Michael Fuhr, patch from Tom Lane after a messier suggestion by me. --- diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index 019ede4b2d..ffeb9b584c 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -690,7 +690,9 @@ pgstat_vacuum_tabstat(void) 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); }