From b28cc92d7d7c9557aab5088666140330fce48b1d Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Mon, 8 Oct 2012 14:17:27 +0300 Subject: [PATCH] Say ANALYZE, not VACUUM, in error message on analyze in hot standby. Tomonaru Katsumata --- src/backend/tcop/utility.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index fde2c8216d..97376bb3ff 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -1123,10 +1123,14 @@ standard_ProcessUtility(Node *parsetree, break; case T_VacuumStmt: - /* we choose to allow this during "read only" transactions */ - PreventCommandDuringRecovery("VACUUM"); - vacuum((VacuumStmt *) parsetree, InvalidOid, true, NULL, false, - isTopLevel); + { + VacuumStmt *stmt = (VacuumStmt *) parsetree; + + /* we choose to allow this during "read only" transactions */ + PreventCommandDuringRecovery((stmt->options & VACOPT_VACUUM) ? + "VACUUM" : "ANALYZE"); + vacuum(stmt, InvalidOid, true, NULL, false, isTopLevel); + } break; case T_ExplainStmt: