|
13 | 13 | * |
14 | 14 | * |
15 | 15 | * IDENTIFICATION |
16 | | - * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.188 2007/01/05 22:19:25 momjian Exp $ |
| 16 | + * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.189 2007/01/16 13:28:56 alvherre Exp $ |
17 | 17 | * |
18 | 18 | *------------------------------------------------------------------------- |
19 | 19 | */ |
@@ -250,11 +250,11 @@ createdb(const CreatedbStmt *stmt) |
250 | 250 | * (exception is to allow CREATE DB while connected to template1). |
251 | 251 | * Otherwise we might copy inconsistent data. |
252 | 252 | */ |
253 | | -if (DatabaseHasActiveBackends(src_dboid, true)) |
| 253 | +if (DatabaseCancelAutovacuumActivity(src_dboid, true)) |
254 | 254 | ereport(ERROR, |
255 | 255 | (errcode(ERRCODE_OBJECT_IN_USE), |
256 | | -errmsg("source database \"%s\" is being accessed by other users", |
257 | | -dbtemplate))); |
| 256 | +errmsg("source database \"%s\" is being accessed by other users", |
| 257 | +dbtemplate))); |
258 | 258 |
|
259 | 259 | /* If encoding is defaulted, use source's encoding */ |
260 | 260 | if (encoding<0) |
@@ -602,7 +602,7 @@ dropdb(const char *dbname, bool missing_ok) |
602 | 602 | * Check for active backends in the target database. (Because we hold the |
603 | 603 | * database lock, no new ones can start after this.) |
604 | 604 | */ |
605 | | -if (DatabaseHasActiveBackends(db_id, false)) |
| 605 | +if (DatabaseCancelAutovacuumActivity(db_id, false)) |
606 | 606 | ereport(ERROR, |
607 | 607 | (errcode(ERRCODE_OBJECT_IN_USE), |
608 | 608 | errmsg("database \"%s\" is being accessed by other users", |
@@ -706,7 +706,7 @@ RenameDatabase(const char *oldname, const char *newname) |
706 | 706 | * Make sure the database does not have active sessions. This is the same |
707 | 707 | * concern as above, but applied to other sessions. |
708 | 708 | */ |
709 | | -if (DatabaseHasActiveBackends(db_id, false)) |
| 709 | +if (DatabaseCancelAutovacuumActivity(db_id, false)) |
710 | 710 | ereport(ERROR, |
711 | 711 | (errcode(ERRCODE_OBJECT_IN_USE), |
712 | 712 | errmsg("database \"%s\" is being accessed by other users", |
|