File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1313 *
1414 *
1515 * IDENTIFICATION
16- * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.191 2007/02/01 19:10:26 momjian Exp $
16+ * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.192 2007/02/09 16:12:18 tgl Exp $
1717 *
1818 *-------------------------------------------------------------------------
1919 */
3737#include "commands/tablespace.h"
3838#include "mb/pg_wchar.h"
3939#include "miscadmin.h"
40+ #include "pgstat.h"
4041#include "postmaster/bgwriter.h"
4142#include "storage/freespace.h"
4243#include "storage/procarray.h"
@@ -644,6 +645,11 @@ dropdb(const char *dbname, bool missing_ok)
644645 */
645646 FreeSpaceMapForgetDatabase (db_id );
646647
648+ /*
649+ * Tell the stats collector to forget it immediately, too.
650+ */
651+ pgstat_drop_database (db_id );
652+
647653 /*
648654 * Tell bgwriter to forget any pending fsync requests for files in the
649655 * database; else it'll fail at next checkpoint.
Original file line number Diff line number Diff line change 1313 *
1414 * Copyright (c) 2001-2007, PostgreSQL Global Development Group
1515 *
16- * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.145 2007/02/07 23:11:29 tgl Exp $
16+ * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.146 2007/02/09 16:12:18 tgl Exp $
1717 * ----------
1818 */
1919#include "postgres.h"
@@ -153,7 +153,6 @@ static void force_statwrite(SIGNAL_ARGS);
153153static void pgstat_beshutdown_hook (int code , Datum arg );
154154
155155static PgStat_StatDBEntry * pgstat_get_db_entry (Oid databaseid , bool create );
156- static void pgstat_drop_database (Oid databaseid );
157156static void pgstat_write_statsfile (void );
158157static HTAB * pgstat_read_statsfile (Oid onlydb );
159158static void backend_read_statsfile (void );
@@ -820,7 +819,7 @@ pgstat_collect_oids(Oid catalogid)
820819 * via future invocations of pgstat_vacuum_tabstat().)
821820 * ----------
822821 */
823- static void
822+ void
824823pgstat_drop_database (Oid databaseid )
825824{
826825 PgStat_MsgDropdb msg ;
Original file line number Diff line number Diff line change 55 *
66 * Copyright (c) 2001-2007, PostgreSQL Global Development Group
77 *
8- * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.53 2007/02/07 23:11:30 tgl Exp $
8+ * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.54 2007/02/09 16:12:19 tgl Exp $
99 * ----------
1010 */
1111#ifndef PGSTAT_H
@@ -378,6 +378,7 @@ extern void pgstat_ping(void);
378378
379379extern void pgstat_report_tabstat (void );
380380extern void pgstat_vacuum_tabstat (void );
381+ extern void pgstat_drop_database (Oid databaseid );
381382extern void pgstat_drop_relation (Oid relid );
382383
383384extern void pgstat_clear_snapshot (void );
You can’t perform that action at this time.
0 commit comments