diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c
index 56eafbff10..8b3de032ee 100644
--- a/src/backend/commands/subscriptioncmds.c
+++ b/src/backend/commands/subscriptioncmds.c
@@ -974,8 +974,8 @@ AlterSubscription_refresh(Subscription *sub, bool copy_data,
 				 *
 				 * Even if new worker for this particular rel is restarted it
 				 * won't be able to make any progress as we hold exclusive
-				 * lock on subscription_rel till the transaction end. It will
-				 * simply exit as there is no corresponding rel entry.
+				 * lock on pg_subscription_rel till the transaction end. It
+				 * will simply exit as there is no corresponding rel entry.
 				 *
 				 * This locking also ensures that the state of rels won't
 				 * change till we are done with this refresh operation.
diff --git a/src/backend/partitioning/partdesc.c b/src/backend/partitioning/partdesc.c
index de06caccd2..7a2b5e57ff 100644
--- a/src/backend/partitioning/partdesc.c
+++ b/src/backend/partitioning/partdesc.c
@@ -55,7 +55,7 @@ static PartitionDesc RelationBuildPartitionDesc(Relation rel,
  * RelationGetPartitionDesc -- get partition descriptor, if relation is partitioned
  *
  * We keep two partdescs in relcache: rd_partdesc includes all partitions
- * (even those being concurrently marked detached), while rd_partdesc_nodetach
+ * (even those being concurrently marked detached), while rd_partdesc_nodetached
  * omits (some of) those.  We store the pg_inherits.xmin value for the latter,
  * to determine whether it can be validly reused in each case, since that
  * depends on the active snapshot.
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index 9f44974473..d6d48210ce 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -4010,7 +4010,7 @@ ReorderBufferStreamTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
 	 * After that we need to reuse the snapshot from the previous run.
 	 *
 	 * Unlike DecodeCommit which adds xids of all the subtransactions in
-	 * snapshot's xip array via SnapBuildCommittedTxn, we can't do that here
+	 * snapshot's xip array via SnapBuildCommitTxn, we can't do that here
 	 * but we do add them to subxip array instead via ReorderBufferCopySnap.
 	 * This allows the catalog changes made in subtransactions decoded till
 	 * now to be visible.
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index fc05e2e293..db50301a63 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -1760,7 +1760,7 @@ ComputeXidHorizons(ComputeXidHorizonsResult *h)
 		 * current top-level xid any.
 		 *
 		 * Without an assigned xid we could use a horizon as aggressive as
-		 * ReadNewTransactionid(), but we can get away with the much cheaper
+		 * GetNewTransactionId(), but we can get away with the much cheaper
 		 * latestCompletedXid + 1: If this backend has no xid there, by
 		 * definition, can't be any newer changes in the temp table than
 		 * latestCompletedXid.
diff --git a/src/backend/utils/activity/pgstat_wal.c b/src/backend/utils/activity/pgstat_wal.c
index 94f1a3b06e..bcaed14d02 100644
--- a/src/backend/utils/activity/pgstat_wal.c
+++ b/src/backend/utils/activity/pgstat_wal.c
@@ -24,7 +24,7 @@
 PgStat_PendingWalStats PendingWalStats = {0};
 
 /*
- * WAL usage counters saved from pgWALUsage at the previous call to
+ * WAL usage counters saved from pgWalUsage at the previous call to
  * pgstat_report_wal(). This is used to calculate how much WAL usage
  * happens between pgstat_report_wal() calls, by subtracting
  * the previous counters from the current ones.
diff --git a/src/include/nodes/queryjumble.h b/src/include/nodes/queryjumble.h
index 204b8f74fd..3499bfd4a0 100644
--- a/src/include/nodes/queryjumble.h
+++ b/src/include/nodes/queryjumble.h
@@ -11,8 +11,8 @@
  *
  *-------------------------------------------------------------------------
  */
-#ifndef QUERYJUBLE_H
-#define QUERYJUBLE_H
+#ifndef QUERYJUMBLE_H
+#define QUERYJUMBLE_H
 
 #include "nodes/parsenodes.h"
 
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index 33ec6102c1..a1a93ad706 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -317,7 +317,7 @@
 
 /*
  * Recover memory used for relcache entries when invalidated.  See
- * RelationBuildDescr() in src/backend/utils/cache/relcache.c.
+ * RelationBuildDesc() in src/backend/utils/cache/relcache.c.
  *
  * This is active automatically for clobber-cache builds when clobbering is
  * active, but can be overridden here by explicitly defining
diff --git a/src/interfaces/libpq/fe-protocol3.c b/src/interfaces/libpq/fe-protocol3.c
index 8ab6a88416..698124e887 100644
--- a/src/interfaces/libpq/fe-protocol3.c
+++ b/src/interfaces/libpq/fe-protocol3.c
@@ -1500,7 +1500,7 @@ getNotify(PGconn *conn)
 	}
 
 	/*
-	 * Store the strings right after the PQnotify structure so it can all be
+	 * Store the strings right after the PGnotify structure so it can all be
 	 * freed at once.  We don't use NAMEDATALEN because we don't want to tie
 	 * this interface to a specific server name length.
 	 */
diff --git a/src/test/recovery/t/023_pitr_prepared_xact.pl b/src/test/recovery/t/023_pitr_prepared_xact.pl
index 6f5a33623f..e55098ef7f 100644
--- a/src/test/recovery/t/023_pitr_prepared_xact.pl
+++ b/src/test/recovery/t/023_pitr_prepared_xact.pl
@@ -1,7 +1,7 @@
 
 # Copyright (c) 2021-2023, PostgreSQL Global Development Group
 
-# Test for point-in-time-recovery (PITR) with prepared transactions
+# Test for point-in-time recovery (PITR) with prepared transactions
 use strict;
 use warnings;
 use PostgreSQL::Test::Cluster;
diff --git a/src/test/subscription/t/004_sync.pl b/src/test/subscription/t/004_sync.pl
index 87381c0829..aa7714c533 100644
--- a/src/test/subscription/t/004_sync.pl
+++ b/src/test/subscription/t/004_sync.pl
@@ -149,7 +149,7 @@ $node_publisher->safe_psql('postgres', "DROP TABLE tab_rep_next");
 $node_subscriber->safe_psql('postgres', "DROP TABLE tab_rep_next");
 $node_subscriber->safe_psql('postgres', "DROP SUBSCRIPTION tap_sub");
 
-# Table tap_rep already has the same records on both publisher and subscriber
+# Table tab_rep already has the same records on both publisher and subscriber
 # at this time. Recreate the subscription which will do the initial copy of
 # the table again and fails due to unique constraint violation.
 $node_subscriber->safe_psql('postgres',
