]> granicus.if.org Git - postgresql/commitdiff
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:20:56 +0000 (14:20 +0300)
Tomonaru Katsumata

src/backend/tcop/utility.c

index 0559998c71f78fcb763fd6f55ecf9d9a61d7d913..f45d92df73dc04add770c6d62482635f8fdc35d7 100644 (file)
@@ -1071,10 +1071,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: