From 367f885a9b82b4c57f1d061692f2fb42a2d57cb6 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 13 Apr 2019 23:17:49 +0300 Subject: [PATCH] checkdb: error at the end of do_amcheck if execution was interrupted --- src/backup.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/backup.c b/src/backup.c index f16294c6..6a88f19f 100644 --- a/src/backup.c +++ b/src/backup.c @@ -1062,7 +1062,6 @@ do_amcheck(void) 0, NULL); n_databases = PQntuples(res_db); - PQclear(res_db); elog(INFO, "Start amchecking PostgreSQL instance"); @@ -1134,14 +1133,11 @@ do_amcheck(void) break; } - /* close initial connection to pgdatabase */ - pgut_disconnect(backup_conn); - /* TODO write better info message */ if (db_skipped) elog(WARNING, "Some databases were not checked"); - if (!check_isok || db_skipped) + if (!check_isok || db_skipped || interrupted) elog(ERROR, "Checkdb --amcheck failed"); elog(INFO, "Checkdb --amcheck executed successfully"); @@ -3511,7 +3507,7 @@ get_index_list(PGresult *res_db, int db_number, strcmp(PQgetvalue(res, 0, 2), "1") != 0) heapallindexed_is_supported = true; - elog(INFO, "Amchecking database %s using module '%s' version %s from schema '%s'", + elog(INFO, "Amchecking database '%s' using module '%s' version %s from schema '%s'", dbname, PQgetvalue(res, 0, 0), PQgetvalue(res, 0, 2), PQgetvalue(res, 0, 1)); if (!heapallindexed_is_supported && heapallindexed)