Say ANALYZE, not VACUUM, in error message on analyze in hot standby.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 8 Oct 2012 11:17:27 +0000 (14:17 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 8 Oct 2012 11:17:27 +0000 (14:17 +0300)
Tomonaru Katsumata

src/backend/tcop/utility.c

index fde2c8216d28c0cab062bd4da630e9cf1057c8c9..97376bb3ff544df5451d64dcef304d53c90db190 100644 (file)
@@ -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: