diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index 48f17ba8d5..bde13e631c 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -1189,7 +1189,7 @@ statext_clauselist_selectivity(PlannerInfo *root, List *clauses, int varRelid,
 }
 
 /*
- * examine_operator_expression
+ * examine_opclause_expression
  *		Split expression into Var and Const parts.
  *
  * Attempts to match the arguments to either (Var op Const) or (Const op Var),
diff --git a/src/backend/utils/adt/network.c b/src/backend/utils/adt/network.c
index 3d536a1662..a6dd8b75aa 100644
--- a/src/backend/utils/adt/network.c
+++ b/src/backend/utils/adt/network.c
@@ -579,7 +579,7 @@ network_abbrev_abort(int memtupcount, SortSupport ssup)
  * IPv4 addresses have a maximum of 32 bits compared to IPv6's 64 bits, so in
  * IPv6 each part may be larger.
  *
- * inet/cdir types compare using these sorting rules. If inequality is detected
+ * inet/cidr types compare using these sorting rules. If inequality is detected
  * at any step, comparison is finished. If any rule is a tie, the algorithm
  * drops through to the next to break it:
  *
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index d40800709b..bcc7404c55 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -2705,7 +2705,7 @@ psql_completion(const char *text, int start, int end)
 		if (TailMatches("(|*,"))
 			COMPLETE_WITH("INPUT", "OUTPUT", "RECEIVE", "SEND",
 						  "TYPMOD_IN", "TYPMOD_OUT", "ANALYZE",
-						  "INTERNALLENGTH", "PASSBYVALUE", "ALIGNMENT",
+						  "INTERNALLENGTH", "PASSEDBYVALUE", "ALIGNMENT",
 						  "STORAGE", "LIKE", "CATEGORY", "PREFERRED",
 						  "DEFAULT", "ELEMENT", "DELIMITER",
 						  "COLLATABLE");
diff --git a/src/include/access/htup_details.h b/src/include/access/htup_details.h
index 27f963e9e8..66d61fd570 100644
--- a/src/include/access/htup_details.h
+++ b/src/include/access/htup_details.h
@@ -233,7 +233,7 @@ struct HeapTupleHeaderData
 
 /*
  * A tuple that has HEAP_XMAX_IS_MULTI and HEAP_XMAX_LOCK_ONLY but neither of
- * XMAX_EXCL_LOCK and XMAX_KEYSHR_LOCK must come from a tuple that was
+ * HEAP_XMAX_EXCL_LOCK and HEAP_XMAX_KEYSHR_LOCK must come from a tuple that was
  * share-locked in 9.2 or earlier and then pg_upgrade'd.
  *
  * In 9.2 and prior, HEAP_XMAX_IS_MULTI was only set when there were multiple
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h
index b986a38575..3f0de6625d 100644
--- a/src/include/access/xlog_internal.h
+++ b/src/include/access/xlog_internal.h
@@ -45,7 +45,7 @@ typedef struct XLogPageHeaderData
 	 * continue on the next page.  xlp_rem_len is the number of bytes
 	 * remaining from a previous page.
 	 *
-	 * Note that xl_rem_len includes backup-block data; that is, it tracks
+	 * Note that xlp_rem_len includes backup-block data; that is, it tracks
 	 * xl_tot_len not xl_len in the initial header.  Also note that the
 	 * continuation data isn't necessarily aligned.
 	 */
diff --git a/src/include/fe_utils/psqlscan_int.h b/src/include/fe_utils/psqlscan_int.h
index 2acb380078..c538ece197 100644
--- a/src/include/fe_utils/psqlscan_int.h
+++ b/src/include/fe_utils/psqlscan_int.h
@@ -27,7 +27,7 @@
  * is the start state number, which is easy enough to manage --- usually,
  * in fact, we just need to set it to INITIAL when changing lexers.  But to
  * make that work at all, we must use re-entrant lexers, so that all the
- * relevant state is in the yyscanner_t attached to the PsqlScanState;
+ * relevant state is in the yyscan_t attached to the PsqlScanState;
  * if we were using lexers with separate static state we would soon end up
  * with dangling buffer pointers in one or the other.  Also note that this
  * is unlikely to work very nicely if the lexers aren't all built with the
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index 432d2d812e..35f1cff61b 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -2981,7 +2981,7 @@ leafSegmentInfo
 leaf_item
 line_t
 lineno_t
-list_qsort_comparator
+list_sort_comparator
 locale_t
 locate_agg_of_level_context
 locate_var_of_level_context
