File tree 3 files changed +11
-5
lines changed 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 13
13
*
14
14
*
15
15
* 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 $
17
17
*
18
18
*-------------------------------------------------------------------------
19
19
*/
37
37
#include "commands/tablespace.h"
38
38
#include "mb/pg_wchar.h"
39
39
#include "miscadmin.h"
40
+ #include "pgstat.h"
40
41
#include "postmaster/bgwriter.h"
41
42
#include "storage/freespace.h"
42
43
#include "storage/procarray.h"
@@ -644,6 +645,11 @@ dropdb(const char *dbname, bool missing_ok)
644
645
*/
645
646
FreeSpaceMapForgetDatabase (db_id );
646
647
648
+ /*
649
+ * Tell the stats collector to forget it immediately, too.
650
+ */
651
+ pgstat_drop_database (db_id );
652
+
647
653
/*
648
654
* Tell bgwriter to forget any pending fsync requests for files in the
649
655
* database; else it'll fail at next checkpoint.
Original file line number Diff line number Diff line change 13
13
*
14
14
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
15
15
*
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 $
17
17
* ----------
18
18
*/
19
19
#include "postgres.h"
@@ -153,7 +153,6 @@ static void force_statwrite(SIGNAL_ARGS);
153
153
static void pgstat_beshutdown_hook (int code , Datum arg );
154
154
155
155
static PgStat_StatDBEntry * pgstat_get_db_entry (Oid databaseid , bool create );
156
- static void pgstat_drop_database (Oid databaseid );
157
156
static void pgstat_write_statsfile (void );
158
157
static HTAB * pgstat_read_statsfile (Oid onlydb );
159
158
static void backend_read_statsfile (void );
@@ -820,7 +819,7 @@ pgstat_collect_oids(Oid catalogid)
820
819
* via future invocations of pgstat_vacuum_tabstat().)
821
820
* ----------
822
821
*/
823
- static void
822
+ void
824
823
pgstat_drop_database (Oid databaseid )
825
824
{
826
825
PgStat_MsgDropdb msg ;
Original file line number Diff line number Diff line change 5
5
*
6
6
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
7
7
*
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 $
9
9
* ----------
10
10
*/
11
11
#ifndef PGSTAT_H
@@ -378,6 +378,7 @@ extern void pgstat_ping(void);
378
378
379
379
extern void pgstat_report_tabstat (void );
380
380
extern void pgstat_vacuum_tabstat (void );
381
+ extern void pgstat_drop_database (Oid databaseid );
381
382
extern void pgstat_drop_relation (Oid relid );
382
383
383
384
extern void pgstat_clear_snapshot (void );
You can’t perform that action at this time.
0 commit comments