diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index a339ebbc4b..6294312ab7 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -884,7 +884,7 @@ BETTER: unrecognized node type: 42
      features can be used, if a fallback is provided.
     </para>
     <para>
-     For example <literal>_StaticAssert()</literal> and
+     For example <literal>_Static_assert()</literal> and
      <literal>__builtin_constant_p</literal> are currently used, even though
      they are from newer revisions of the C standard and a
      <productname>GCC</productname> extension respectively. If not available
diff --git a/src/backend/access/hash/hashpage.c b/src/backend/access/hash/hashpage.c
index defdc9b408..838ee68c86 100644
--- a/src/backend/access/hash/hashpage.c
+++ b/src/backend/access/hash/hashpage.c
@@ -1510,7 +1510,7 @@ _hash_getcachedmetap(Relation rel, Buffer *metabuf, bool force_refresh)
 		 * It's important that we don't set rd_amcache to an invalid value.
 		 * Either MemoryContextAlloc or _hash_getbuf could fail, so don't
 		 * install a pointer to the newly-allocated storage in the actual
-		 * relcache entry until both have succeeeded.
+		 * relcache entry until both have succeeded.
 		 */
 		if (rel->rd_amcache == NULL)
 			cache = MemoryContextAlloc(rel->rd_indexcxt,
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index 5fabccc72a..8abcfdf841 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -748,7 +748,7 @@ ProcArrayApplyRecoveryInfo(RunningTransactions running)
 	 * sort them first.
 	 *
 	 * Some of the new xids are top-level xids and some are subtransactions.
-	 * We don't call SubtransSetParent because it doesn't matter yet. If we
+	 * We don't call SubTransSetParent because it doesn't matter yet. If we
 	 * aren't overflowed then all xids will fit in snapshot and so we don't
 	 * need subtrans. If we later overflow, an xid assignment record will add
 	 * xids to subtrans. If RunningTransactionsData is overflowed then we
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index 2376bda497..15fda7f122 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -79,7 +79,7 @@
 #undef StrNCpy
 #include <shlwapi.h>
 #ifdef StrNCpy
-#undef STrNCpy
+#undef StrNCpy
 #endif
 #endif
 
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c
index 0864838867..9e34055801 100644
--- a/src/backend/utils/adt/varlena.c
+++ b/src/backend/utils/adt/varlena.c
@@ -2052,10 +2052,10 @@ varstr_sortsupport(SortSupport ssup, Oid typid, Oid collid)
 
 	/*
 	 * If we're using abbreviated keys, or if we're using a locale-aware
-	 * comparison, we need to initialize a StringSortSupport object.  Both
-	 * cases will make use of the temporary buffers we initialize here for
-	 * scratch space (and to detect requirement for BpChar semantics from
-	 * caller), and the abbreviation case requires additional state.
+	 * comparison, we need to initialize a VarStringSortSupport object.
+	 * Both cases will make use of the temporary buffers we initialize here
+	 * for scratch space (and to detect requirement for BpChar semantics
+	 * from caller), and the abbreviation case requires additional state.
 	 */
 	if (abbreviate || !collate_c)
 	{
diff --git a/src/include/access/reloptions.h b/src/include/access/reloptions.h
index a1912f41e6..6d392e4d5a 100644
--- a/src/include/access/reloptions.h
+++ b/src/include/access/reloptions.h
@@ -237,7 +237,7 @@ typedef struct
 
 /*
  * For use by code reading options already parsed: get a pointer to the string
- * value itself.  "optstruct" is the StdRdOption struct or equivalent, "member"
+ * value itself.  "optstruct" is the StdRdOptions struct or equivalent, "member"
  * is the struct member corresponding to the string option
  */
 #define GET_STRING_RELOPTION(optstruct, member) \
diff --git a/src/include/catalog/namespace.h b/src/include/catalog/namespace.h
index 187d76de18..edb98842fc 100644
--- a/src/include/catalog/namespace.h
+++ b/src/include/catalog/namespace.h
@@ -105,7 +105,7 @@ extern Oid	ConversionGetConid(const char *conname);
 extern bool ConversionIsVisible(Oid conid);
 
 extern Oid	get_statistics_object_oid(List *names, bool missing_ok);
-extern bool StatisticsObjIsVisible(Oid stxid);
+extern bool StatisticsObjIsVisible(Oid relid);
 
 extern Oid	get_ts_parser_oid(List *names, bool missing_ok);
 extern bool TSParserIsVisible(Oid prsId);
diff --git a/src/include/storage/standbydefs.h b/src/include/storage/standbydefs.h
index befdbf60bf..9a612a5834 100644
--- a/src/include/storage/standbydefs.h
+++ b/src/include/storage/standbydefs.h
@@ -1,6 +1,6 @@
 /*-------------------------------------------------------------------------
  *
- * standbydef.h
+ * standbydefs.h
  *	   Frontend exposed definitions for hot standby mode.
  *
  *
diff --git a/src/pl/plpython/plpy_subxactobject.c b/src/pl/plpython/plpy_subxactobject.c
index 53fd36edba..5dfb8a4cb5 100644
--- a/src/pl/plpython/plpy_subxactobject.c
+++ b/src/pl/plpython/plpy_subxactobject.c
@@ -132,7 +132,7 @@ PLy_subtransaction_enter(PyObject *self, PyObject *unused)
  *
  * Exit an explicit subtransaction. exc_type is an exception type, exc
  * is the exception object, tb is the traceback.  If exc_type is None,
- * commit the subtransactiony, if not abort it.
+ * commit the subtransaction, if not abort it.
  *
  * The method signature is chosen to allow subtransaction objects to
  * be used as context managers as described in
diff --git a/src/test/recovery/t/012_subtransactions.pl b/src/test/recovery/t/012_subtransactions.pl
index c184553694..292cd40fe2 100644
--- a/src/test/recovery/t/012_subtransactions.pl
+++ b/src/test/recovery/t/012_subtransactions.pl
@@ -76,7 +76,7 @@ is($psql_out, '6', "Check nextXid handling for prepared subtransactions");
 
 ###############################################################################
 # Check that replay will correctly set 2PC with more than
-# PGPROC_MAX_CACHED_SUBXIDS subtransations and also show data properly
+# PGPROC_MAX_CACHED_SUBXIDS subtransactions and also show data properly
 # on promotion
 ###############################################################################
 $node_master->psql('postgres', "DELETE FROM t_012_tbl");
