diff --git a/meson.build b/meson.build
index 3405cc07ee..65f7c88dba 100644
--- a/meson.build
+++ b/meson.build
@@ -2963,7 +2963,7 @@ endif
 # generation happens during install, so that's not a real issue.
 nls_mo_targets = []
 if libintl.found() and meson.version().version_compare('>=0.60')
-  # use range() to avoid the flattening of the list that forech() would do
+  # use range() to avoid the flattening of the list that foreach() would do
   foreach off : range(0, nls_targets.length())
     # i18n.gettext() list containing 1) list of built .mo files 2) maintainer
     # -pot target 3) maintainer -pot target
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c
index 5ce8a0831b..872cbd454d 100644
--- a/src/backend/executor/execUtils.c
+++ b/src/backend/executor/execUtils.c
@@ -1403,7 +1403,7 @@ GetResultRTEPermissionInfo(ResultRelInfo *relinfo, EState *estate)
 }
 
 /*
- * GetResultRelCheckAsUser
+ * ExecGetResultRelCheckAsUser
  *		Returns the user to modify passed-in result relation as
  *
  * The user is chosen by looking up the relation's or, if a child table, its
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c
index 3a67389508..5b596f1e7a 100644
--- a/src/backend/executor/nodeModifyTable.c
+++ b/src/backend/executor/nodeModifyTable.c
@@ -904,7 +904,7 @@ ExecInsert(ModifyTableContext *context,
 			 * If these are the first tuples stored in the buffers, add the
 			 * target rel and the mtstate to the
 			 * es_insert_pending_result_relations and
-			 * es_insert_pending_modifytables lists respectively, execpt in
+			 * es_insert_pending_modifytables lists respectively, except in
 			 * the case where flushing was done above, in which case they
 			 * would already have been added to the lists, so no need to do
 			 * this.
diff --git a/src/backend/rewrite/rewriteManip.c b/src/backend/rewrite/rewriteManip.c
index d28d0da621..52b3f77078 100644
--- a/src/backend/rewrite/rewriteManip.c
+++ b/src/backend/rewrite/rewriteManip.c
@@ -343,7 +343,7 @@ contains_multiexpr_param(Node *node, void *context)
  * the RTEs in 'src_rtable' to now point to the perminfos' indexes in
  * *dst_perminfos.
  *
- * Note that this changes both 'dst_rtable' and 'dst_perminfo' destructively,
+ * Note that this changes both 'dst_rtable' and 'dst_perminfos' destructively,
  * so the caller should have better passed safe-to-modify copies.
  */
 void
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c
index 8f7522d103..45dc2273b7 100644
--- a/src/backend/utils/adt/acl.c
+++ b/src/backend/utils/adt/acl.c
@@ -5020,7 +5020,7 @@ member_can_set_role(Oid member, Oid role)
 }
 
 /*
- * Permission violation eror unless able to SET ROLE to target role.
+ * Permission violation error unless able to SET ROLE to target role.
  */
 void
 check_can_set_role(Oid member, Oid role)
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index f6c0c5ca1a..6df9121a17 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -1387,7 +1387,7 @@ check_GUC_name_for_parameter_acl(const char *name)
  *
  * This performs two sanity checks.  First, it checks that the initial
  * value of a GUC is the same when declared and when loaded to prevent
- * anybody looking at the C declarations of these GUCS from being fooled by
+ * anybody looking at the C declarations of these GUCs from being fooled by
  * mismatched values.  Second, it checks for incorrect flag combinations.
  *
  * The following validation rules apply for the values:
diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c
index 8266c117a3..745578d855 100644
--- a/src/bin/pg_dump/pg_dump_sort.c
+++ b/src/bin/pg_dump/pg_dump_sort.c
@@ -137,7 +137,7 @@ static const int dbObjectTypePriority[] =
 	PRIO_DEFAULT_ACL,			/* DO_DEFAULT_ACL */
 	PRIO_TRANSFORM,				/* DO_TRANSFORM */
 	PRIO_LARGE_OBJECT,			/* DO_LARGE_OBJECT */
-	PRIO_LARGE_OBJECT_DATA,		/* DO_LARGE_OJECT_DATA */
+	PRIO_LARGE_OBJECT_DATA,		/* DO_LARGE_OBJECT_DATA */
 	PRIO_PRE_DATA_BOUNDARY,		/* DO_PRE_DATA_BOUNDARY */
 	PRIO_POST_DATA_BOUNDARY,	/* DO_POST_DATA_BOUNDARY */
 	PRIO_EVENT_TRIGGER,			/* DO_EVENT_TRIGGER */
diff --git a/src/interfaces/libpq/t/004_load_balance_dns.pl b/src/interfaces/libpq/t/004_load_balance_dns.pl
index 8347eea161..d9b382dba9 100644
--- a/src/interfaces/libpq/t/004_load_balance_dns.pl
+++ b/src/interfaces/libpq/t/004_load_balance_dns.pl
@@ -14,10 +14,10 @@ if ($ENV{PG_TEST_EXTRA} !~ /\bload_balance\b/)
 
 # This tests loadbalancing based on a DNS entry that contains multiple records
 # for different IPs. Since setting up a DNS server is more effort than we
-# consider reasonable to run this test, this situation is instead immitated by
+# consider reasonable to run this test, this situation is instead imitated by
 # using a hosts file where a single hostname maps to multiple different IP
 # addresses. This test requires the administrator to add the following lines to
-# the hosts file (if we detect that this hasn't happend we skip the test):
+# the hosts file (if we detect that this hasn't happened we skip the test):
 #
 # 127.0.0.1 pg-loadbalancetest
 # 127.0.0.2 pg-loadbalancetest
diff --git a/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm b/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
index 60fc9416f9..a9c102949f 100644
--- a/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
+++ b/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
@@ -201,7 +201,7 @@ sub query
 	$self->{timeout}->start() if (defined($self->{query_timer_restart}));
 
 	# Feed the query to psql's stdin, followed by \n (so psql processes the
-	# line), by a ; (so that psql issues the query, if it doesnt't include a ;
+	# line), by a ; (so that psql issues the query, if it doesn't include a ;
 	# itself), and a separator echoed with \echo, that we can wait on.
 	my $banner = "background_psql: QUERY_SEPARATOR";
 	$self->{stdin} .= "$query\n;\n\\echo $banner\n";
