aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/dbcommands.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2007-01-16 13:28:57 +0000
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2007-01-16 13:28:57 +0000
commiteb63cc3da82cec03c54a9534a6c91d287078abd1 (patch)
treea8181fbd037cc02c1eeb68202b8632b20f536665 /src/backend/commands/dbcommands.c
parent02609893da8cac7689ec5173bc7d815e6f27ad2e (diff)
downloadpostgresql-eb63cc3da82cec03c54a9534a6c91d287078abd1.tar.gz
postgresql-eb63cc3da82cec03c54a9534a6c91d287078abd1.zip
Arrange for autovacuum to be killed when another operation wants to be alone
accessing it, like DROP DATABASE. This allows the regression tests to pass with autovacuum enabled, which open the gates for finally enabling autovacuum by default.
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r--src/backend/commands/dbcommands.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index ef0aff99ac8..18340481d23 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.188 2007/01/05 22:19:25 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.189 2007/01/16 13:28:56 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
@@ -250,11 +250,11 @@ createdb(const CreatedbStmt *stmt)
* (exception is to allow CREATE DB while connected to template1).
* Otherwise we might copy inconsistent data.
*/
- if (DatabaseHasActiveBackends(src_dboid, true))
+ if (DatabaseCancelAutovacuumActivity(src_dboid, true))
ereport(ERROR,
(errcode(ERRCODE_OBJECT_IN_USE),
- errmsg("source database \"%s\" is being accessed by other users",
- dbtemplate)));
+ errmsg("source database \"%s\" is being accessed by other users",
+ dbtemplate)));
/* If encoding is defaulted, use source's encoding */
if (encoding < 0)
@@ -602,7 +602,7 @@ dropdb(const char *dbname, bool missing_ok)
* Check for active backends in the target database. (Because we hold the
* database lock, no new ones can start after this.)
*/
- if (DatabaseHasActiveBackends(db_id, false))
+ if (DatabaseCancelAutovacuumActivity(db_id, false))
ereport(ERROR,
(errcode(ERRCODE_OBJECT_IN_USE),
errmsg("database \"%s\" is being accessed by other users",
@@ -706,7 +706,7 @@ RenameDatabase(const char *oldname, const char *newname)
* Make sure the database does not have active sessions. This is the same
* concern as above, but applied to other sessions.
*/
- if (DatabaseHasActiveBackends(db_id, false))
+ if (DatabaseCancelAutovacuumActivity(db_id, false))
ereport(ERROR,
(errcode(ERRCODE_OBJECT_IN_USE),
errmsg("database \"%s\" is being accessed by other users",