diff --git a/contrib/pgcrypto/pgp-pgsql.c b/contrib/pgcrypto/pgp-pgsql.c
index 0984e01a14..3feadf7b70 100644
--- a/contrib/pgcrypto/pgp-pgsql.c
+++ b/contrib/pgcrypto/pgp-pgsql.c
@@ -761,7 +761,7 @@ pgp_pub_decrypt_text(PG_FUNCTION_ARGS)
  */
 
 /*
- * Helper function for pgp_armor. Converts arrays of keys and values into
+ * Helper function for pg_armor. Converts arrays of keys and values into
  * plain C arrays, and checks that they don't contain invalid characters.
  */
 static int
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index ef2e97afd1..e7295abda2 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -5509,7 +5509,7 @@ int PQendcopy(PGconn *conn);
        It should either be issued when the  last  string  has  been sent
        to  the  server using <xref linkend="libpq-PQputline"/> or when the
        last string has been  received  from  the  server using
-       <function>PGgetline</function>.  It must be issued or the server
+       <function>PQgetline</function>.  It must be issued or the server
        will get <quote>out of sync</quote> with  the client.   Upon return
        from this function, the server is ready to receive the next SQL
        command.  The return value is 0  on  successful  completion,
diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c
index 291412e305..88ce37c08d 100644
--- a/src/backend/catalog/aclchk.c
+++ b/src/backend/catalog/aclchk.c
@@ -4114,7 +4114,7 @@ pg_largeobject_aclmask_snapshot(Oid lobj_oid, Oid roleid,
 		return mask;
 
 	/*
-	 * Get the largeobject's ACL from pg_language_metadata
+	 * Get the largeobject's ACL from pg_largeobject_metadata
 	 */
 	pg_lo_meta = table_open(LargeObjectMetadataRelationId,
 							AccessShareLock);
diff --git a/src/backend/catalog/information_schema.sql b/src/backend/catalog/information_schema.sql
index 9c21ac7c62..c42e76ea89 100644
--- a/src/backend/catalog/information_schema.sql
+++ b/src/backend/catalog/information_schema.sql
@@ -48,10 +48,6 @@ CREATE FUNCTION _pg_expandarray(IN anyarray, OUT x anyelement, OUT n int)
                                         pg_catalog.array_upper($1,1),
                                         1) as g(s)';
 
-CREATE FUNCTION _pg_keysequal(smallint[], smallint[]) RETURNS boolean
-    LANGUAGE sql IMMUTABLE PARALLEL SAFE  -- intentionally not STRICT, to allow inlining
-    AS 'select $1 operator(pg_catalog.<@) $2 and $2 operator(pg_catalog.<@) $1';
-
 /* Given an index's OID and an underlying-table column number, return the
  * column's position in the index (NULL if not there) */
 CREATE FUNCTION _pg_index_position(oid, smallint) RETURNS int
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index 8f51f59f8a..2cde93e9ad 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -5177,7 +5177,7 @@ make_group_input_target(PlannerInfo *root, PathTarget *final_target)
  * a regular aggregation node would, plus any aggregates used in HAVING;
  * except that the Aggref nodes should be marked as partial aggregates.
  *
- * In addition, we'd better emit any Vars and PlaceholderVars that are
+ * In addition, we'd better emit any Vars and PlaceHolderVars that are
  * used outside of Aggrefs in the aggregation tlist and HAVING.  (Presumably,
  * these would be Vars that are grouped by or used in grouping expressions.)
  *
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index b4f2b28b51..2bb14cdd02 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -6122,7 +6122,7 @@ pgstat_recv_resetcounter(PgStat_MsgResetcounter *msg, int len)
 }
 
 /* ----------
- * pgstat_recv_resetshared() -
+ * pgstat_recv_resetsharedcounter() -
  *
  *	Reset some shared statistics of the cluster.
  * ----------
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 40fe6ed3d3..47b0517596 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -1171,7 +1171,7 @@ AtEOXact_Snapshot(bool isCommit, bool resetXmin)
 
 	/*
 	 * During normal commit processing, we call ProcArrayEndTransaction() to
-	 * reset the PgXact->xmin. That call happens prior to the call to
+	 * reset the MyPgXact->xmin. That call happens prior to the call to
 	 * AtEOXact_Snapshot(), so we need not touch xmin here at all.
 	 */
 	if (resetXmin)
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 507b082acb..80def7d401 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -25,8 +25,8 @@
  *
  * The rule for developers is: if you commit a change that requires
  * an initdb, you should update the catalog version number (as well as
- * notifying the pghackers mailing list, which has been the informal
- * practice for a long time).
+ * notifying the pgsql-hackers mailing list, which has been the
+ * informal practice for a long time).
  *
  * The catalog version number is placed here since modifying files in
  * include/catalog is the most common kind of initdb-forcing change.
diff --git a/src/interfaces/ecpg/pgtypeslib/datetime.c b/src/interfaces/ecpg/pgtypeslib/datetime.c
index 53fcd2157f..9ee460b9a1 100644
--- a/src/interfaces/ecpg/pgtypeslib/datetime.c
+++ b/src/interfaces/ecpg/pgtypeslib/datetime.c
@@ -623,7 +623,7 @@ PGTYPESdate_defmt_asc(date * d, const char *fmt, const char *str)
 
 			/*
 			 * evil[tm] hack: if we read the pgtypes_date_months and haven't
-			 * found a match, reset list to point to pgtypes_date_months_short
+			 * found a match, reset list to point to months (abbreviations)
 			 * and reset the counter variable i
 			 */
 			if (list == pgtypes_date_months)
diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h
index fcf2bc2cab..0fe3e53539 100644
--- a/src/interfaces/libpq/libpq-int.h
+++ b/src/interfaces/libpq/libpq-int.h
@@ -169,7 +169,7 @@ struct pg_result
 	int			ntups;
 	int			numAttributes;
 	PGresAttDesc *attDescs;
-	PGresAttValue **tuples;		/* each PGresTuple is an array of
+	PGresAttValue **tuples;		/* each PGresult tuple is an array of
 								 * PGresAttValue's */
 	int			tupArrSize;		/* allocated size of tuples array */
 	int			numParameters;
