diff --git a/config/config.sub b/config/config.sub
index de4259e404..3c26ae98b2 100644
--- a/config/config.sub
+++ b/config/config.sub
@@ -1721,7 +1721,7 @@ case $os in
 	# Likewise for "kernel-abi"
 	eabi* | gnueabi*)
 		;;
-	# VxWorks passes extra cpu info in the 4th filed.
+	# VxWorks passes extra cpu info in the 4th field.
 	simlinux | simwindows | spe)
 		;;
 	# Now accept the basic system types.
diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c
index 5ab86238a9..bf3a2b843a 100644
--- a/src/backend/access/transam/slru.c
+++ b/src/backend/access/transam/slru.c
@@ -1478,7 +1478,7 @@ SlruPagePrecedesTestOffset(SlruCtl ctl, int per_page, uint32 offset)
  *
  * This assumes every uint32 >= FirstNormalTransactionId is a valid key.  It
  * assumes each value occupies a contiguous, fixed-size region of SLRU bytes.
- * (MultiXactMemberCtl separates flags from XIDs.  AsyncCtl has
+ * (MultiXactMemberCtl separates flags from XIDs.  NotifyCtl has
  * variable-length entries, no keys, and no random access.  These unit tests
  * do not apply to them.)
  */
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 343fe61115..6536cf2418 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -8017,7 +8017,7 @@ ATPrepDropExpression(Relation rel, AlterTableCmd *cmd, bool recurse, bool recurs
 	 * is a bit complicated.  GENERATED clauses must be attached to the column
 	 * definition and cannot be added later like DEFAULT, so if a child table
 	 * has a generation expression that the parent does not have, the child
-	 * column will necessarily be an attlocal column.  So to implement ONLY
+	 * column will necessarily be an attislocal column.  So to implement ONLY
 	 * here, we'd need extra code to update attislocal of the direct child
 	 * tables, somewhat similar to how DROP COLUMN does it, so that the
 	 * resulting state can be properly dumped and restored.
@@ -10930,7 +10930,7 @@ ATExecAlterConstraint(Relation rel, AlterTableCmd *cmd, bool recurse,
 	}
 
 	/*
-	 * ATExecConstrRecurse already invalidated relcache for the relations
+	 * ATExecAlterConstrRecurse already invalidated relcache for the relations
 	 * having the constraint itself; here we also invalidate for relations
 	 * that have any triggers that are part of the constraint.
 	 */
diff --git a/src/backend/optimizer/plan/planagg.c b/src/backend/optimizer/plan/planagg.c
index d168620665..a6090167f5 100644
--- a/src/backend/optimizer/plan/planagg.c
+++ b/src/backend/optimizer/plan/planagg.c
@@ -386,7 +386,7 @@ build_minmax_path(PlannerInfo *root, MinMaxAggInfo *mminfo,
 	ntest = makeNode(NullTest);
 	ntest->nulltesttype = IS_NOT_NULL;
 	ntest->arg = copyObject(mminfo->target);
-	/* we checked it wasn't a rowtype in find_minmax_aggs_walker */
+	/* we checked it wasn't a rowtype in can_minmax_aggs */
 	ntest->argisrow = false;
 	ntest->location = -1;
 
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index acf6cf4866..a723d9db78 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -957,7 +957,7 @@ stmtmulti:	stmtmulti ';' toplevel_stmt
 
 /*
  * toplevel_stmt includes BEGIN and END.  stmt does not include them, because
- * those words have different meanings in function bodys.
+ * those words have different meanings in function bodies.
  */
 toplevel_stmt:
 			stmt
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 277a28fc13..4f86d44d6e 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -3069,7 +3069,7 @@ AtEOXact_Files(bool isCommit)
 /*
  * BeforeShmemExit_Files
  *
- * before_shmem_access hook to clean up temp files during backend shutdown.
+ * before_shmem_exit hook to clean up temp files during backend shutdown.
  * Here, we want to clean up *all* temp files including interXact ones.
  */
 static void
diff --git a/src/backend/storage/lmgr/spin.c b/src/backend/storage/lmgr/spin.c
index e406bea201..6052779d9c 100644
--- a/src/backend/storage/lmgr/spin.c
+++ b/src/backend/storage/lmgr/spin.c
@@ -37,7 +37,7 @@
 #define NUM_EMULATION_SEMAPHORES (NUM_SPINLOCK_SEMAPHORES + NUM_ATOMICS_SEMAPHORES)
 #else
 #define NUM_EMULATION_SEMAPHORES (NUM_SPINLOCK_SEMAPHORES)
-#endif							/* DISABLE_ATOMICS */
+#endif							/* HAVE_ATOMICS */
 
 PGSemaphore *SpinlockSemaArray;
 
diff --git a/src/bin/pg_rewind/rewind_source.h b/src/bin/pg_rewind/rewind_source.h
index 69ad0e495f..98af3b58ee 100644
--- a/src/bin/pg_rewind/rewind_source.h
+++ b/src/bin/pg_rewind/rewind_source.h
@@ -83,4 +83,4 @@ extern rewind_source *init_libpq_source(PGconn *conn);
 /* in local_source.c */
 extern rewind_source *init_local_source(const char *datadir);
 
-#endif							/* FETCH_H */
+#endif							/* REWIND_SOURCE_H */
diff --git a/src/include/access/tableam.h b/src/include/access/tableam.h
index bb6d4f0315..b19d50ecc2 100644
--- a/src/include/access/tableam.h
+++ b/src/include/access/tableam.h
@@ -358,7 +358,7 @@ typedef struct TableAmRoutine
 	 * allowed by the AM.
 	 *
 	 * Implementations can assume that scan_set_tidrange is always called
-	 * before can_getnextslot_tidrange or after scan_rescan and before any
+	 * before scan_getnextslot_tidrange or after scan_rescan and before any
 	 * further calls to scan_getnextslot_tidrange.
 	 */
 	void		(*scan_set_tidrange) (TableScanDesc scan,
