*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.191 2007/02/01 19:10:26 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.192 2007/02/09 16:12:18 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "commands/tablespace.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
+#include "pgstat.h"
#include "postmaster/bgwriter.h"
#include "storage/freespace.h"
#include "storage/procarray.h"
*/
FreeSpaceMapForgetDatabase(db_id);
+ /*
+ * Tell the stats collector to forget it immediately, too.
+ */
+ pgstat_drop_database(db_id);
+
/*
* Tell bgwriter to forget any pending fsync requests for files in the
* database; else it'll fail at next checkpoint.
*
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.145 2007/02/07 23:11:29 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.146 2007/02/09 16:12:18 tgl Exp $
* ----------
*/
#include "postgres.h"
static void pgstat_beshutdown_hook(int code, Datum arg);
static PgStat_StatDBEntry *pgstat_get_db_entry(Oid databaseid, bool create);
-static void pgstat_drop_database(Oid databaseid);
static void pgstat_write_statsfile(void);
static HTAB *pgstat_read_statsfile(Oid onlydb);
static void backend_read_statsfile(void);
* via future invocations of pgstat_vacuum_tabstat().)
* ----------
*/
-static void
+void
pgstat_drop_database(Oid databaseid)
{
PgStat_MsgDropdb msg;
*
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.53 2007/02/07 23:11:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.54 2007/02/09 16:12:19 tgl Exp $
* ----------
*/
#ifndef PGSTAT_H
extern void pgstat_report_tabstat(void);
extern void pgstat_vacuum_tabstat(void);
+extern void pgstat_drop_database(Oid databaseid);
extern void pgstat_drop_relation(Oid relid);
extern void pgstat_clear_snapshot(void);