summaryrefslogtreecommitdiff
path: root/src/backend/postmaster
diff options
context:
space:
mode:
authorTom Lane2004-10-28 00:39:59 +0000
committerTom Lane2004-10-28 00:39:59 +0000
commite6f9bf9b7fce69d491cefd388a5004448bd38073 (patch)
tree2d1294d1c3aced63a96465f9b9966e9ff870d8c6 /src/backend/postmaster
parenta7049b52e3137cfebfb3d73d8779a9094809d52a (diff)
On Windows, force a checkpoint just before dropping a database's physical
files and directories. This ensures that the bgwriter will close any open file references it is holding for files therein, which is needed for the rmdir() to succeed. Andrew Dunstan and Tom Lane.
Diffstat (limited to 'src/backend/postmaster')
-rw-r--r--src/backend/postmaster/bgwriter.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c
index f0b32b12654..25b953da2fa 100644
--- a/src/backend/postmaster/bgwriter.c
+++ b/src/backend/postmaster/bgwriter.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.9 2004/10/12 21:54:40 petere Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.10 2004/10/28 00:39:59 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -347,6 +347,15 @@ BackgroundWriterMain(void)
CreateCheckPoint(false, force_checkpoint);
/*
+ * After any checkpoint, close all smgr files. This is so we
+ * won't hang onto smgr references to deleted files
+ * indefinitely. (It is safe to do this because this process
+ * does not have a relcache, and so no dangling references
+ * could remain.)
+ */
+ smgrcloseall();
+
+ /*
* Indicate checkpoint completion to any waiting backends.
*/
BgWriterShmem->ckpt_done = BgWriterShmem->ckpt_started;
@@ -359,15 +368,6 @@ BackgroundWriterMain(void)
*/
last_checkpoint_time = now;
- /*
- * After any checkpoint, close all smgr files. This is so we
- * won't hang onto smgr references to deleted files
- * indefinitely. (It is safe to do this because this process
- * does not have a relcache, and so no dangling references
- * could remain.)
- */
- smgrcloseall();
-
/* Nap for configured time before rechecking */
n = 1;
}