diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-02-19 23:16:27 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-02-19 23:16:27 +0000 |
commit | 0845ee39585675c1523243deff011df5317d4723 (patch) | |
tree | 8a021c7e4684ac9eba5c89a81e5ea715cf8c2f0e /src | |
parent | 254eef2f28e871caa6d5db212e9d0027ffed8756 (diff) | |
download | postgresql-0845ee39585675c1523243deff011df5317d4723.tar.gz postgresql-0845ee39585675c1523243deff011df5317d4723.zip |
New arrangement to always let the bgwriter do checkpoints broke
CHECKPOINT and some other commands in the context of a standalone
backend. Allow a standalone backend to do its own checkpoints.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/postmaster/bgwriter.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c index 12202e00811..85c63960a24 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.13 2005/01/10 20:02:20 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.13.4.1 2005/02/19 23:16:27 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -510,6 +510,23 @@ RequestCheckpoint(bool waitforit) sig_atomic_t old_started = bgs->ckpt_started; /* + * If in a standalone backend, just do it ourselves. + */ + if (!IsPostmasterEnvironment) + { + CreateCheckPoint(false, true); + + /* + * After any checkpoint, close all smgr files. This is so we + * won't hang onto smgr references to deleted files + * indefinitely. + */ + smgrcloseall(); + + return; + } + + /* * Send signal to request checkpoint. When waitforit is false, we * consider failure to send the signal to be nonfatal. */ |