nslots_active, nslots_active)));
}
- /*
- * Check for other backends in the target database. (Because we hold the
- * database lock, no new ones can start after this.)
- *
- * As in CREATE DATABASE, check this after other error conditions.
- */
- if (CountOtherDBBackends(db_id, ¬herbackends, &npreparedxacts))
- ereport(ERROR,
- (errcode(ERRCODE_OBJECT_IN_USE),
- errmsg("database \"%s\" is being accessed by other users",
- dbname),
- errdetail_busy_db(notherbackends, npreparedxacts)));
-
/*
* Check if there are subscriptions defined in the target database.
*
"There are %d subscriptions.",
nsubscriptions, nsubscriptions)));
+ /*
+ * Check for other backends in the target database. (Because we hold the
+ * database lock, no new ones can start after this.)
+ *
+ * As in CREATE DATABASE, check this after other error conditions.
+ */
+ if (CountOtherDBBackends(db_id, ¬herbackends, &npreparedxacts))
+ ereport(ERROR,
+ (errcode(ERRCODE_OBJECT_IN_USE),
+ errmsg("database \"%s\" is being accessed by other users",
+ dbname),
+ errdetail_busy_db(notherbackends, npreparedxacts)));
+
/*
* Remove the database's tuple from pg_database.
*/