aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/dbcommands.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-03-29 21:17:39 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-03-29 21:17:39 +0000
commit6d61cdec0761dc1f86a196899825b52b1186d00e (patch)
tree654a0eceb4b0b324ca05c292cb1877d6a45501ee /src/backend/commands/dbcommands.c
parent2154e1c11e4fbb6b41f6db1ea7c49e25f98d0df7 (diff)
downloadpostgresql-6d61cdec0761dc1f86a196899825b52b1186d00e.tar.gz
postgresql-6d61cdec0761dc1f86a196899825b52b1186d00e.zip
Clean up and document the API for XLogOpenRelation and XLogReadBuffer.
This commit doesn't make much functional change, but it does eliminate some duplicated code --- for instance, PageIsNew tests are now done inside XLogReadBuffer rather than by each caller. The GIST xlog code still needs a lot of love, but I'll worry about that separately.
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r--src/backend/commands/dbcommands.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index a9b19ab89a4..209362782a8 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.178 2006/03/24 04:32:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.179 2006/03/29 21:17:38 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -671,7 +671,7 @@ dropdb(const char *dbname, bool missing_ok)
* is important to ensure that no remaining backend tries to write out a
* dirty buffer to the dead database later...
*/
- DropBuffers(db_id);
+ DropDatabaseBuffers(db_id);
/*
* Also, clean out any entries in the shared free space map.
@@ -1377,11 +1377,16 @@ dbase_redo(XLogRecPtr lsn, XLogRecord *record)
dst_path = GetDatabasePath(xlrec->db_id, xlrec->tablespace_id);
- /*
- * Drop pages for this database that are in the shared buffer cache
- */
- DropBuffers(xlrec->db_id);
+ /* Drop pages for this database that are in the shared buffer cache */
+ DropDatabaseBuffers(xlrec->db_id);
+
+ /* Also, clean out any entries in the shared free space map */
+ FreeSpaceMapForgetDatabase(xlrec->db_id);
+
+ /* Clean out the xlog relcache too */
+ XLogDropDatabase(xlrec->db_id);
+ /* And remove the physical files */
if (!rmtree(dst_path, true))
ereport(WARNING,
(errmsg("could not remove database directory \"%s\"",