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:21:11 +0000 (14:21 +0300)
Tomonaru Katsumata

src/backend/tcop/utility.c

index ec36644a492ab69d5306b52294daab0599f332fe..c2d15a1728aa177db1f70024ebe4cb04ab169864 100644 (file)
@@ -1006,10 +1006,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: