From c0c07609da60b1787774d6a627371e4c7cbfefc0 Mon Sep 17 00:00:00 2001 From: Michael Tharp Date: Fri, 18 Mar 2011 10:12:35 -0400 Subject: [PATCH] Create auto databases as needed when doing PAUSE. --- src/admin.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/admin.c b/src/admin.c index 6f19379..0125de7 100644 --- a/src/admin.c +++ b/src/admin.c @@ -891,8 +891,14 @@ static bool admin_cmd_pause(PgSocket *admin, const char *arg) PgDatabase *db; log_info("PAUSE '%s' command issued", arg); db = find_database(arg); - if (db == NULL) - return admin_error(admin, "no such database: %s", arg); + if (db == NULL) { + db = register_auto_database(arg); + if (db == NULL) { + return admin_error(admin, "no such database: %s", arg); + } else { + slog_info(admin, "registered new auto-database for PAUSE: %s", arg); + } + } if (db == admin->pool->db) return admin_error(admin, "cannot pause admin db: %s", arg); db->db_paused = 1; -- 2.40.0