From: Alvaro Herrera Date: Thu, 7 Jun 2007 19:07:11 +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=093affd249c61518146b0a5006726d4fdb433021;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 5529f2917b..edf150b9fe 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -919,7 +919,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); }