1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-03 22:24:49 +03:00

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

Fuhr, patch from Tom Lane after a messier suggestion by me.
This commit is contained in:
Alvaro Herrera 2007-06-07 19:07:13 +00:00
parent 7c92618676
commit 02c31e885d

View File

@ -13,7 +13,7 @@
* *
* Copyright (c) 2001-2006, PostgreSQL Global Development Group * Copyright (c) 2001-2006, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.140.2.3 2007/03/01 20:07:02 tgl Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.140.2.4 2007/06/07 19:07:13 alvherre Exp $
* ---------- * ----------
*/ */
#include "postgres.h" #include "postgres.h"
@ -690,7 +690,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);
} }