diff --git a/doc/src/sgml/ref/set_role.sgml b/doc/src/sgml/ref/set_role.sgml
index 0ef6eb9a9c..9ab0d6af04 100644
--- a/doc/src/sgml/ref/set_role.sgml
+++ b/doc/src/sgml/ref/set_role.sgml
@@ -70,7 +70,7 @@ RESET ROLE
    effectively drops all the privileges assigned directly to the session user
    and to the other roles it is a member of, leaving only the privileges
    available to the named role.  On the other hand, if the session user role
-   has the <literal>NOINHERITS</literal> attribute, <command>SET ROLE</command> drops the
+   has the <literal>NOINHERIT</literal> attribute, <command>SET ROLE</command> drops the
    privileges assigned directly to the session user and instead acquires the
    privileges available to the named role.
   </para>
diff --git a/src/backend/access/hash/hash_xlog.c b/src/backend/access/hash/hash_xlog.c
index d7b7098110..86e7210acb 100644
--- a/src/backend/access/hash/hash_xlog.c
+++ b/src/backend/access/hash/hash_xlog.c
@@ -706,7 +706,7 @@ hash_xlog_squeeze_page(XLogReaderState *record)
 
 		/*
 		 * if the page on which are adding tuples is a page previous to freed
-		 * overflow page, then update its nextblno.
+		 * overflow page, then update its nextblkno.
 		 */
 		if (xldata->is_prev_bucket_same_wrt)
 		{
diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c
index d0b9013caf..b30cf9e989 100644
--- a/src/backend/access/nbtree/nbtsort.c
+++ b/src/backend/access/nbtree/nbtsort.c
@@ -657,7 +657,7 @@ _bt_blwritepage(BTWriteState *wstate, Page page, BlockNumber blkno)
 	/* XLOG stuff */
 	if (wstate->btws_use_wal)
 	{
-		/* We use the heap NEWPAGE record type for this */
+		/* We use the XLOG_FPI record type for this */
 		log_newpage(&wstate->index->rd_node, MAIN_FORKNUM, blkno, page, true);
 	}
 
diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c
index 5e629d29ea..f5b477be2b 100644
--- a/src/backend/utils/adt/xml.c
+++ b/src/backend/utils/adt/xml.c
@@ -227,7 +227,6 @@ const TableFuncRoutine XmlTableRoutine =
 /* from SQL/XML:2008 section 4.9 */
 #define NAMESPACE_XSD "http://www.w3.org/2001/XMLSchema"
 #define NAMESPACE_XSI "http://www.w3.org/2001/XMLSchema-instance"
-#define NAMESPACE_SQLXML "http://standards.iso.org/iso/9075/2003/sqlxml"
 
 
 #ifdef USE_LIBXML
diff --git a/src/bin/pg_resetwal/pg_resetwal.c b/src/bin/pg_resetwal/pg_resetwal.c
index 9d9c33d78c..74063ebf2f 100644
--- a/src/bin/pg_resetwal/pg_resetwal.c
+++ b/src/bin/pg_resetwal/pg_resetwal.c
@@ -934,8 +934,8 @@ RewriteControlFile(void)
  *
  * On entry, ControlFile.checkPointCopy.redo and ControlFile.xlog_seg_size
  * are assumed valid (note that we allow the old xlog seg size to differ
- * from what we're using).  On exit, newXlogId and newXlogSeg are set to
- * suitable values for the beginning of replacement WAL (in our seg size).
+ * from what we're using).  On exit, newXlogSegNo is set to suitable
+ * value for the beginning of replacement WAL (in our seg size).
  */
 static void
 FindEndOfXLOG(void)
diff --git a/src/common/unicode/norm_test.c b/src/common/unicode/norm_test.c
index 421dd4e68e..fee58a184a 100644
--- a/src/common/unicode/norm_test.c
+++ b/src/common/unicode/norm_test.c
@@ -66,7 +66,7 @@ main(int argc, char **argv)
 
 		if (pg_wcscmp(test->output, result) != 0)
 		{
-			printf("FAILURE (Normalizationdata.txt line %d):\n", test->linenum);
+			printf("FAILURE (NormalizationTest.txt line %d):\n", test->linenum);
 			printf("input:\t%s\n", print_wchar_str(test->input));
 			printf("expected:\t%s\n", print_wchar_str(test->output));
 			printf("got\t%s\n", print_wchar_str(result));
diff --git a/src/include/access/nbtxlog.h b/src/include/access/nbtxlog.h
index 9beccc86ea..afa614da25 100644
--- a/src/include/access/nbtxlog.h
+++ b/src/include/access/nbtxlog.h
@@ -259,4 +259,4 @@ extern void btree_desc(StringInfo buf, XLogReaderState *record);
 extern const char *btree_identify(uint8 info);
 extern void btree_mask(char *pagedata, BlockNumber blkno);
 
-#endif							/* NBXLOG_H */
+#endif							/* NBTXLOG_H */
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h
index ac2bfaff1e..9c25a805f2 100644
--- a/src/include/commands/tablecmds.h
+++ b/src/include/commands/tablecmds.h
@@ -87,7 +87,7 @@ extern void RangeVarCallbackOwnsTable(const RangeVar *relation,
 									  Oid relId, Oid oldRelId, void *arg);
 
 extern void RangeVarCallbackOwnsRelation(const RangeVar *relation,
-										 Oid relId, Oid oldRelId, void *noCatalogs);
+										 Oid relId, Oid oldRelId, void *arg);
 extern bool PartConstraintImpliedByRelConstraint(Relation scanrel,
 												 List *partConstraint);
 
diff --git a/src/include/executor/execExpr.h b/src/include/executor/execExpr.h
index 8e7f7c3d13..d21dbead0a 100644
--- a/src/include/executor/execExpr.h
+++ b/src/include/executor/execExpr.h
@@ -576,7 +576,7 @@ typedef struct ExprEvalStep
 		/* for EEOP_WINDOW_FUNC */
 		struct
 		{
-			/* out-of-line state, modified by nodeWindowFunc.c */
+			/* out-of-line state, modified by nodeWindowAgg.c */
 			WindowFuncExprState *wfstate;
 		}			window_func;
 
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index a329ebbf93..d262b57021 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -3732,8 +3732,8 @@ internal_ping(PGconn *conn)
 	 * PQPING_NO_RESPONSE.  This result could be somewhat misleading for a
 	 * pre-7.4 server, since it won't send back a SQLSTATE, but those are long
 	 * out of support.  Another corner case where the server could return a
-	 * failure without a SQLSTATE is fork failure, but NO_RESPONSE isn't
-	 * totally unreasonable for that anyway.  We expect that every other
+	 * failure without a SQLSTATE is fork failure, but PQPING_NO_RESPONSE
+	 * isn't totally unreasonable for that anyway.  We expect that every other
 	 * failure case in a modern server will produce a report with a SQLSTATE.
 	 *
 	 * NOTE: whenever we get around to making libpq generate SQLSTATEs for
