From 1a305b7ad56a14becf68adede745cb3635b80555 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Mon, 15 Mar 1999 14:07:44 +0000
Subject: [PATCH] Drop buffers before destroying database files.

---
 src/backend/commands/dbcommands.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 475dfc982d..89813430d2 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.30 1999/02/13 23:15:05 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.31 1999/03/15 14:07:44 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -125,16 +125,15 @@ destroydb(char *dbname)
 			"delete from pg_database where pg_database.oid = \'%d\'::oid", db_id);
 	pg_exec_query(buf);
 
+	/* drop pages for this database that are in the shared buffer cache */
+	DropBuffers(db_id);
+
 	/*
 	 * remove the data directory. If the DELETE above failed, this will
 	 * not be reached
 	 */
-
 	snprintf(buf, 512, "rm -r %s", path);
 	system(buf);
-
-	/* drop pages for this database that are in the shared buffer cache */
-	DropBuffers(db_id);
 }
 
 static HeapTuple
-- 
2.40.0