diff --git a/doc/src/sgml/ref/create_aggregate.sgml b/doc/src/sgml/ref/create_aggregate.sgml
index ca0e9db8b1..644657dd5e 100644
--- a/doc/src/sgml/ref/create_aggregate.sgml
+++ b/doc/src/sgml/ref/create_aggregate.sgml
@@ -211,7 +211,7 @@ CREATE [ OR REPLACE ] AGGREGATE <replaceable class="parameter">name</replaceable
    as described in <xref linkend="xaggr-moving-aggregates"/>.  This requires
    specifying the <literal>MSFUNC</literal>, <literal>MINVFUNC</literal>,
    and <literal>MSTYPE</literal> parameters, and optionally
-   the <literal>MSPACE</literal>, <literal>MFINALFUNC</literal>,
+   the <literal>MSSPACE</literal>, <literal>MFINALFUNC</literal>,
    <literal>MFINALFUNC_EXTRA</literal>, <literal>MFINALFUNC_MODIFY</literal>,
    and <literal>MINITCOND</literal> parameters.  Except for <literal>MINVFUNC</literal>,
    these parameters work like the corresponding simple-aggregate parameters
diff --git a/src/backend/catalog/pg_aggregate.c b/src/backend/catalog/pg_aggregate.c
index 7cab039ded..201242e796 100644
--- a/src/backend/catalog/pg_aggregate.c
+++ b/src/backend/catalog/pg_aggregate.c
@@ -733,7 +733,7 @@ AggregateCreate(const char *aggName,
 	 * Create dependencies for the aggregate (above and beyond those already
 	 * made by ProcedureCreate).  Note: we don't need an explicit dependency
 	 * on aggTransType since we depend on it indirectly through transfn.
-	 * Likewise for aggmTransType using the mtransfunc, if it exists.
+	 * Likewise for aggmTransType using the mtransfn, if it exists.
 	 *
 	 * If we're replacing an existing definition, ProcedureCreate deleted all
 	 * our existing dependencies, so we have to do the same things here either
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index fc1e1564a6..95881a8550 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -1854,7 +1854,7 @@ get_db_info(const char *name, LOCKMODE lockmode,
 				/* limit of frozen XIDs */
 				if (dbFrozenXidP)
 					*dbFrozenXidP = dbform->datfrozenxid;
-				/* minimum MultixactId */
+				/* minimum MultiXactId */
 				if (dbMinMultiP)
 					*dbMinMultiP = dbform->datminmxid;
 				/* default tablespace for this database */
diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c
index 1ed2838ad4..d3b8afa35c 100644
--- a/src/backend/tcop/pquery.c
+++ b/src/backend/tcop/pquery.c
@@ -1023,9 +1023,10 @@ FillPortalStore(Portal portal, bool isTopLevel)
 
 			/*
 			 * Run the portal to completion just as for the default
-			 * MULTI_QUERY case, but send the primary query's output to the
-			 * tuplestore.  Auxiliary query outputs are discarded.  Set the
-			 * portal's holdSnapshot to the snapshot used (or a copy of it).
+			 * PORTAL_MULTI_QUERY case, but send the primary query's output
+			 * to the tuplestore.  Auxiliary query outputs are discarded.
+			 * Set the portal's holdSnapshot to the snapshot used
+			 * (or a copy of it).
 			 */
 			PortalRunMulti(portal, isTopLevel, true,
 						   treceiver, None_Receiver, completionTag);
diff --git a/src/bin/pgevent/README b/src/bin/pgevent/README
index 3d0329ec33..10ec8d2d62 100644
--- a/src/bin/pgevent/README
+++ b/src/bin/pgevent/README
@@ -3,7 +3,7 @@ src/bin/pgevent/README
 pgevent
 =======
 
-MSG000001.bin is a binary file, result of Microsoft MC compiler. MC compiler
+MSG00001.bin is a binary file, result of Microsoft MC compiler. MC compiler
 can be downloaded for free with MS Core SDK but it is not included with MSYS
 tools and I didn't find an alternative way to compile MC file.
 
diff --git a/src/include/commands/dbcommands.h b/src/include/commands/dbcommands.h
index 28bf21153d..154c8157ee 100644
--- a/src/include/commands/dbcommands.h
+++ b/src/include/commands/dbcommands.h
@@ -26,7 +26,7 @@ extern Oid	AlterDatabase(ParseState *pstate, AlterDatabaseStmt *stmt, bool isTop
 extern Oid	AlterDatabaseSet(AlterDatabaseSetStmt *stmt);
 extern ObjectAddress AlterDatabaseOwner(const char *dbname, Oid newOwnerId);
 
-extern Oid	get_database_oid(const char *dbname, bool missingok);
+extern Oid	get_database_oid(const char *dbname, bool missing_ok);
 extern char *get_database_name(Oid dbid);
 
 extern void check_encoding_locale_matches(int encoding, const char *collate, const char *ctype);
diff --git a/src/include/statistics/statistics.h b/src/include/statistics/statistics.h
index cb7bc630e9..3b7da3be60 100644
--- a/src/include/statistics/statistics.h
+++ b/src/include/statistics/statistics.h
@@ -22,7 +22,7 @@
 #define STATS_NDISTINCT_MAGIC		0xA352BFA4	/* struct identifier */
 #define STATS_NDISTINCT_TYPE_BASIC	1	/* struct version */
 
-/* MVDistinctItem represents a single combination of columns */
+/* MVNDistinctItem represents a single combination of columns */
 typedef struct MVNDistinctItem
 {
 	double		ndistinct;		/* ndistinct value for this combination */
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index 2db13d3030..c480999c51 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -2091,7 +2091,7 @@ plperlu_validator(PG_FUNCTION_ARGS)
 
 
 /*
- * Uses mksafefunc/mkunsafefunc to create a subroutine whose text is
+ * Uses mkfunc to create a subroutine whose text is
  * supplied in s, and returns a reference to it
  */
 static void
