diff options
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r-- | src/backend/commands/dbcommands.c | 12 |
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", |