diff --git a/contrib/basebackup_to_shell/t/001_basic.pl b/contrib/basebackup_to_shell/t/001_basic.pl
index a278df3f91..84ad93f614 100644
--- a/contrib/basebackup_to_shell/t/001_basic.pl
+++ b/contrib/basebackup_to_shell/t/001_basic.pl
@@ -49,7 +49,7 @@ $node->command_fails_like(
 	qr/shell command for backup is not configured/,
 	'fails if basebackup_to_shell.command is not set');
 
-# Configure basebackup_to_shell.command and reload the configuation file.
+# Configure basebackup_to_shell.command and reload the configuration file.
 my $backup_path         = PostgreSQL::Test::Utils::tempdir;
 my $escaped_backup_path = $backup_path;
 $escaped_backup_path =~ s{\\}{\\\\}g
diff --git a/src/backend/access/transam/xlogrecovery.c b/src/backend/access/transam/xlogrecovery.c
index 02d1b2cd6d..d51b43be54 100644
--- a/src/backend/access/transam/xlogrecovery.c
+++ b/src/backend/access/transam/xlogrecovery.c
@@ -8,7 +8,7 @@
  * or standby mode, depending on configuration options and the state of
  * the control file and possible backup label file.  PerformWalRecovery()
  * performs the actual WAL replay, calling the rmgr-specific redo routines.
- * EndWalRecovery() performs end-of-recovery checks and cleanup actions,
+ * FinishWalRecovery() performs end-of-recovery checks and cleanup actions,
  * and prepares information needed to initialize the WAL for writes.  In
  * addition to these three main functions, there are a bunch of functions
  * for interrogating recovery state and controlling the recovery process.
@@ -505,7 +505,7 @@ EnableStandbyMode(void)
  * disk does after initializing other subsystems, but before calling
  * PerformWalRecovery().
  *
- * This initializes some global variables like ArchiveModeRequested, and
+ * This initializes some global variables like ArchiveRecoveryRequested, and
  * StandbyModeRequested and InRecovery.
  */
 void
diff --git a/src/backend/catalog/pg_publication.c b/src/backend/catalog/pg_publication.c
index 47637f28ab..c488b6370b 100644
--- a/src/backend/catalog/pg_publication.c
+++ b/src/backend/catalog/pg_publication.c
@@ -497,7 +497,7 @@ compare_int16(const void *a, const void *b)
  * and a Bitmapset with them; verify that each attribute is appropriate
  * to have in a publication column list (no system or generated attributes,
  * no duplicates).  Additional checks with replica identity are done later;
- * see check_publication_columns.
+ * see pub_collist_contains_invalid_column.
  *
  * Note that the attribute numbers are *not* offset by
  * FirstLowInvalidHeapAttributeNumber; system columns are forbidden so this
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c
index c5a6babccc..729ebd86d1 100644
--- a/src/backend/utils/adt/acl.c
+++ b/src/backend/utils/adt/acl.c
@@ -189,7 +189,7 @@ getid(const char *s, char *n, Node *escontext)
 /*
  * Write a role name at *p, adding double quotes if needed.
  * There must be at least (2*NAMEDATALEN)+2 bytes available at *p.
- * This needs to be kept in sync with copyAclUserName in pg_dump/dumputils.c
+ * This needs to be kept in sync with dequoteAclUserName in pg_dump/dumputils.c
  */
 static void
 putid(char *p, const char *s)
diff --git a/src/backend/utils/mmgr/generation.c b/src/backend/utils/mmgr/generation.c
index ae48cdbaa9..4fb8663cd6 100644
--- a/src/backend/utils/mmgr/generation.c
+++ b/src/backend/utils/mmgr/generation.c
@@ -544,7 +544,7 @@ GenerationBlockInit(GenerationContext *context, GenerationBlock *block,
 
 /*
  * GenerationBlockIsEmpty
- *		Returns true iif 'block' contains no chunks
+ *		Returns true iff 'block' contains no chunks
  */
 static inline bool
 GenerationBlockIsEmpty(GenerationBlock *block)
diff --git a/src/backend/utils/sort/logtape.c b/src/backend/utils/sort/logtape.c
index 52b8898d5e..46b53bfeb7 100644
--- a/src/backend/utils/sort/logtape.c
+++ b/src/backend/utils/sort/logtape.c
@@ -681,7 +681,7 @@ LogicalTapeCreate(LogicalTapeSet *lts)
 {
 	/*
 	 * The only thing that currently prevents creating new tapes in leader is
-	 * the fact that BufFiles opened using BufFileOpenShared() are read-only
+	 * the fact that BufFiles opened using BufFileOpenFileSet() are read-only
 	 * by definition, but that could be changed if it seemed worthwhile.  For
 	 * now, writing to the leader tape will raise a "Bad file descriptor"
 	 * error, so tuplesort must avoid writing to the leader tape altogether.
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 7d11ae3478..c9ca44d8b7 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -1630,7 +1630,7 @@ ThereAreNoPriorRegisteredSnapshots(void)
 }
 
 /*
- * HaveRegisteredOrActiveSnapshots
+ * HaveRegisteredOrActiveSnapshot
  *		Is there any registered or active snapshot?
  *
  * NB: Unless pushed or active, the cached catalog snapshot will not cause
diff --git a/src/include/utils/sortsupport.h b/src/include/utils/sortsupport.h
index aaca6634cb..475ed1d5b8 100644
--- a/src/include/utils/sortsupport.h
+++ b/src/include/utils/sortsupport.h
@@ -372,7 +372,7 @@ ApplySortAbbrevFullComparator(Datum datum1, bool isNull1,
 
 /*
  * Datum comparison functions that we have specialized sort routines for.
- * Datatypes that install these as their comparator or abbrevated comparator
+ * Datatypes that install these as their comparator or abbreviated comparator
  * are eligible for faster sorting.
  */
 extern int	ssup_datum_unsigned_cmp(Datum x, Datum y, SortSupport ssup);
diff --git a/src/tools/mark_pgdllimport.pl b/src/tools/mark_pgdllimport.pl
index 69fa8e4ae9..0cf71dbc25 100755
--- a/src/tools/mark_pgdllimport.pl
+++ b/src/tools/mark_pgdllimport.pl
@@ -6,7 +6,7 @@
 #	Perl script that tries to add PGDLLIMPORT markings to PostgreSQL
 #	header files.
 #
-# This relies on a few idiosyncracies of the PostgreSQL coding style,
+# This relies on a few idiosyncrasies of the PostgreSQL coding style,
 # such as the fact that we always use "extern" in function
 # declarations, and that we don't use // comments. It's not very
 # smart and may not catch all cases.
