diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c
index 49df05653b..7d1b219bbc 100644
--- a/src/backend/access/gist/gistutil.c
+++ b/src/backend/access/gist/gistutil.c
@@ -120,7 +120,7 @@ gistjoinvector(IndexTuple *itvec, int *len, IndexTuple *additvec, int addlen)
 }
 
 /*
- * make plain IndexTupleVector
+ * make plain IndexTuple vector
  */
 
 IndexTupleData *
diff --git a/src/backend/access/index/genam.c b/src/backend/access/index/genam.c
index 42aaa5bad6..2599b5d342 100644
--- a/src/backend/access/index/genam.c
+++ b/src/backend/access/index/genam.c
@@ -557,8 +557,8 @@ systable_endscan(SysScanDesc sysscan)
  * we could do a heapscan and sort, but the uses are in places that
  * probably don't need to still work with corrupted catalog indexes.)
  * For the moment, therefore, these functions are merely the thinnest of
- * wrappers around index_beginscan/index_getnext.  The main reason for their
- * existence is to centralize possible future support of lossy operators
+ * wrappers around index_beginscan/index_getnext_slot.  The main reason for
+ * their existence is to centralize possible future support of lossy operators
  * in catalog scans.
  */
 SysScanDesc
diff --git a/src/backend/access/spgist/spgscan.c b/src/backend/access/spgist/spgscan.c
index 557dd18d7e..1cf28ecf2f 100644
--- a/src/backend/access/spgist/spgscan.c
+++ b/src/backend/access/spgist/spgscan.c
@@ -643,7 +643,7 @@ spgInnerTest(SpGistScanOpaque so, SpGistSearchItem *item,
 				continue;
 
 			/*
-			 * Use infinity distances if innerConsistent() failed to return
+			 * Use infinity distances if innerConsistentFn() failed to return
 			 * them or if is a NULL item (their distances are really unused).
 			 */
 			distances = out.distances ? out.distances[i] : so->infDistances;
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index b6c9353cbd..da3d250986 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -9158,7 +9158,7 @@ CreateRestartPoint(int flags)
 
 	/*
 	 * Update pg_control, using current time.  Check that it still shows
-	 * IN_ARCHIVE_RECOVERY state and an older checkpoint, else do nothing;
+	 * DB_IN_ARCHIVE_RECOVERY state and an older checkpoint, else do nothing;
 	 * this is a quick hack to make sure nothing really bad happens if somehow
 	 * we get here after the end-of-recovery checkpoint.
 	 */
diff --git a/src/include/mb/pg_wchar.h b/src/include/mb/pg_wchar.h
index 60c5615799..0339b98041 100644
--- a/src/include/mb/pg_wchar.h
+++ b/src/include/mb/pg_wchar.h
@@ -544,7 +544,7 @@ extern int	pg_mbstrlen_with_len(const char *mbstr, int len);
 extern int	pg_mbcliplen(const char *mbstr, int len, int limit);
 extern int	pg_encoding_mbcliplen(int encoding, const char *mbstr,
 								  int len, int limit);
-extern int	pg_mbcharcliplen(const char *mbstr, int len, int imit);
+extern int	pg_mbcharcliplen(const char *mbstr, int len, int limit);
 extern int	pg_encoding_max_length(int encoding);
 extern int	pg_database_encoding_max_length(void);
 extern mbcharacter_incrementer pg_database_encoding_character_incrementer(void);
diff --git a/src/include/utils/formatting.h b/src/include/utils/formatting.h
index 5b275dc985..741c5f4809 100644
--- a/src/include/utils/formatting.h
+++ b/src/include/utils/formatting.h
@@ -7,7 +7,7 @@
  *	 Portions Copyright (c) 1999-2019, PostgreSQL Global Development Group
  *
  *	 The PostgreSQL routines for a DateTime/int/float/numeric formatting,
- *	 inspire with Oracle TO_CHAR() / TO_DATE() / TO_NUMBER() routines.
+ *	 inspired by the Oracle TO_CHAR() / TO_DATE() / TO_NUMBER() routines.
  *
  *	 Karel Zak
  *
diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c
index 4394b420a1..4e2016c7ae 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -2073,9 +2073,9 @@ ecpg_do_prologue(int lineno, const int compat, const int force_indicator,
 	 * offset - offset between ith and (i+1)th entry in an array, normally
 	 * that means sizeof(type)
 	 * ind_type - type of indicator variable
-	 * ind_value - pointer to indicator variable
+	 * ind_pointer - pointer to indicator variable
 	 * ind_varcharsize - empty
-	 * ind_arraysize - arraysize of indicator array
+	 * ind_arrsize - arraysize of indicator array
 	 * ind_offset - indicator offset
 	 *------
 	 */
diff --git a/src/pl/plpgsql/src/pl_gram.y b/src/pl/plpgsql/src/pl_gram.y
index dea95f4230..a82930e81d 100644
--- a/src/pl/plpgsql/src/pl_gram.y
+++ b/src/pl/plpgsql/src/pl_gram.y
@@ -3691,7 +3691,7 @@ plpgsql_sql_error_callback(void *arg)
 			internalerrposition(myerrpos + errpos - cbarg->leaderlen - 1);
 	}
 
-	/* In any case, flush errposition --- we want internalerrpos only */
+	/* In any case, flush errposition --- we want internalerrposition only */
 	errposition(0);
 }
 
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c
index eecd2032d8..b318854d6c 100644
--- a/src/pl/tcl/pltcl.c
+++ b/src/pl/tcl/pltcl.c
@@ -1634,7 +1634,7 @@ compile_pltcl_function(Oid fn_oid, Oid tgreloid,
 
 		/************************************************************
 		 * prefix procedure body with
-		 * upvar #0 <internal_procname> GD
+		 * upvar #0 <internal_proname> GD
 		 * and with appropriate setting of arguments
 		 ************************************************************/
 		Tcl_DStringAppend(&proc_internal_body, "upvar #0 ", -1);
diff --git a/src/test/recovery/t/011_crash_recovery.pl b/src/test/recovery/t/011_crash_recovery.pl
index 5dc52412ca..526a3481fb 100644
--- a/src/test/recovery/t/011_crash_recovery.pl
+++ b/src/test/recovery/t/011_crash_recovery.pl
@@ -51,7 +51,7 @@ my $xid = $stdout;
 chomp($xid);
 
 is($node->safe_psql('postgres', qq[SELECT txid_status('$xid');]),
-	'in progress', 'own xid is in-progres');
+	'in progress', 'own xid is in-progress');
 
 # Crash and restart the postmaster
 $node->stop('immediate');
