diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index d432f8208d..2b8de85e14 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -208,8 +208,8 @@ analyze_rel(Oid relid, RangeVar *relation, int options,
 
 	/*
 	 * Check that it's a plain table, materialized view, or foreign table; we
-	 * used to do this in get_rel_oids() but seems safer to check after we've
-	 * locked the relation.
+	 * used to do this in expand_vacuum_rel() but seems safer to check after
+	 * we've locked the relation.
 	 */
 	if (onerel->rd_rel->relkind == RELKIND_RELATION ||
 		onerel->rd_rel->relkind == RELKIND_MATVIEW)
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index f439b55ea5..3db96cac11 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -1445,7 +1445,7 @@ vacuum_rel(Oid relid, RangeVar *relation, int options, VacuumParams *params)
 
 	/*
 	 * Check that it's a vacuumable relation; we used to do this in
-	 * get_rel_oids() but seems safer to check after we've locked the
+	 * expand_vacuum_rel() but seems safer to check after we've locked the
 	 * relation.
 	 */
 	if (onerel->rd_rel->relkind != RELKIND_RELATION &&
