Skip to content

Commit d09affd

Browse files
committed
Say ANALYZE, not VACUUM, in error message on analyze in hot standby.
Tomonaru Katsumata
1 parent bea3410 commit d09affd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/backend/tcop/utility.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,10 +1006,14 @@ standard_ProcessUtility(Node *parsetree,
10061006
break;
10071007

10081008
case T_VacuumStmt:
1009-
/* we choose to allow this during "read only" transactions */
1010-
PreventCommandDuringRecovery("VACUUM");
1011-
vacuum((VacuumStmt *) parsetree, InvalidOid, true, NULL, false,
1012-
isTopLevel);
1009+
{
1010+
VacuumStmt *stmt = (VacuumStmt *) parsetree;
1011+
1012+
/* we choose to allow this during "read only" transactions */
1013+
PreventCommandDuringRecovery((stmt->options & VACOPT_VACUUM) ?
1014+
"VACUUM" : "ANALYZE");
1015+
vacuum(stmt, InvalidOid, true, NULL, false, isTopLevel);
1016+
}
10131017
break;
10141018

10151019
case T_ExplainStmt:

0 commit comments

Comments
 (0)