From eddbf39756fb7d58f1bdc7582af7d6462410a3e1 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 17 Jan 2007 16:25:01 +0000 Subject: Extend yesterday's patch so that the bgwriter is also told to forget pending fsyncs during DROP DATABASE. Obviously necessary in hindsight :-( --- src/backend/commands/dbcommands.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/backend/commands/dbcommands.c') diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 18340481d23..38db4ae3b92 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -13,7 +13,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.189 2007/01/16 13:28:56 alvherre Exp $ + * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.190 2007/01/17 16:25:01 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -40,6 +40,7 @@ #include "postmaster/bgwriter.h" #include "storage/freespace.h" #include "storage/procarray.h" +#include "storage/smgr.h" #include "utils/acl.h" #include "utils/builtins.h" #include "utils/flatfiles.h" @@ -643,6 +644,12 @@ dropdb(const char *dbname, bool missing_ok) */ FreeSpaceMapForgetDatabase(db_id); + /* + * Tell bgwriter to forget any pending fsync requests for files in the + * database; else it'll fail at next checkpoint. + */ + ForgetDatabaseFsyncRequests(db_id); + /* * On Windows, force a checkpoint so that the bgwriter doesn't hold any * open files, which would cause rmdir() to fail. -- cgit v1.2.3