diff --git a/contrib/spi/refint.example b/contrib/spi/refint.example
index d0ff744164..299166d504 100644
--- a/contrib/spi/refint.example
+++ b/contrib/spi/refint.example
@@ -5,7 +5,7 @@ CREATE TABLE A (
 );
 CREATE UNIQUE INDEX AI ON A (ID);
 
---Columns REFB of table B and REFC of C are foreign keys referenting ID of A:
+--Columns REFB of table B and REFC of C are foreign keys referencing ID of A:
 
 CREATE TABLE B (
 	REFB	int4
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c
index e9ca4b8252..745be4581b 100644
--- a/src/backend/access/gist/gist.c
+++ b/src/backend/access/gist/gist.c
@@ -37,7 +37,7 @@ static bool gistinserttuples(GISTInsertState *state, GISTInsertStack *stack,
 							 Buffer leftchild, Buffer rightchild,
 							 bool unlockbuf, bool unlockleftchild);
 static void gistfinishsplit(GISTInsertState *state, GISTInsertStack *stack,
-							GISTSTATE *giststate, List *splitinfo, bool releasebuf);
+							GISTSTATE *giststate, List *splitinfo, bool unlockbuf);
 static void gistprunepage(Relation rel, Page page, Buffer buffer,
 						  Relation heapRel);
 
diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c
index a065419cdb..1af31c2b9f 100644
--- a/src/backend/catalog/catalog.c
+++ b/src/backend/catalog/catalog.c
@@ -317,13 +317,6 @@ IsSharedRelation(Oid relationId)
  * consecutive existing OIDs.  This is a mostly reasonable assumption for
  * system catalogs.
  *
- * This is exported separately because there are cases where we want to use
- * an index that will not be recognized by RelationGetOidIndex: TOAST tables
- * have indexes that are usable, but have multiple columns and are on
- * ordinary columns rather than a true OID column.  This code will work
- * anyway, so long as the OID is the index's first column.  The caller must
- * pass in the actual heap attnum of the OID column, however.
- *
  * Caller must have a suitable lock on the relation.
  */
 Oid
diff --git a/src/backend/catalog/pg_constraint.c b/src/backend/catalog/pg_constraint.c
index b6145593a3..56568b0105 100644
--- a/src/backend/catalog/pg_constraint.c
+++ b/src/backend/catalog/pg_constraint.c
@@ -580,7 +580,7 @@ RemoveConstraintById(Oid conId)
 		rel = table_open(con->conrelid, AccessExclusiveLock);
 
 		/*
-		 * We need to update the relcheck count if it is a check constraint
+		 * We need to update the relchecks count if it is a check constraint
 		 * being dropped.  This update will force backends to rebuild relcache
 		 * entries when we commit.
 		 */
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index 3a9a994733..11446a1056 100644
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -1811,7 +1811,7 @@ append_nonpartial_cost(List *subpaths, int numpaths, int parallel_workers)
 		return 0;
 
 	/*
-	 * Array length is number of workers or number of relevants paths,
+	 * Array length is number of workers or number of relevant paths,
 	 * whichever is less.
 	 */
 	arrlen = Min(parallel_workers, numpaths);
diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c
index 11bbe2c397..61544f65ad 100644
--- a/src/backend/postmaster/checkpointer.c
+++ b/src/backend/postmaster/checkpointer.c
@@ -750,7 +750,7 @@ IsCheckpointOnSchedule(double progress)
 	 * We compare the current WAL insert location against the location
 	 * computed before calling CreateCheckPoint. The code in XLogInsert that
 	 * actually triggers a checkpoint when CheckPointSegments is exceeded
-	 * compares against RedoRecptr, so this is not completely accurate.
+	 * compares against RedoRecPtr, so this is not completely accurate.
 	 * However, it's good enough for our purposes, we're only calculating an
 	 * estimate anyway.
 	 *
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index c77d47c01c..85748dd05e 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -1075,7 +1075,7 @@ LWLockDequeueSelf(LWLock *lock)
 		 */
 
 		/*
-		 * Reset releaseOk if somebody woke us before we removed ourselves -
+		 * Reset RELEASE_OK flag if somebody woke us before we removed ourselves -
 		 * they'll have set it to false.
 		 */
 		pg_atomic_fetch_or_u32(&lock->state, LW_FLAG_RELEASE_OK);
diff --git a/src/include/regex/regex.h b/src/include/regex/regex.h
index dc31899aa4..0caf16982c 100644
--- a/src/include/regex/regex.h
+++ b/src/include/regex/regex.h
@@ -109,7 +109,6 @@ typedef struct
 #define REG_NLSTOP	000100		/* \n doesn't match . or [^ ] */
 #define REG_NLANCH	000200		/* ^ matches after \n, $ before */
 #define REG_NEWLINE 000300		/* newlines are line terminators */
-#define REG_PEND	000400		/* ugh -- backward-compatibility hack */
 #define REG_EXPECT	001000		/* report details on partial/limited matches */
 #define REG_BOSONLY 002000		/* temporary kludge for BOS-only matches */
 #define REG_DUMP	004000		/* none of your business :-) */
@@ -123,7 +122,6 @@ typedef struct
  */
 #define REG_NOTBOL	0001		/* BOS is not BOL */
 #define REG_NOTEOL	0002		/* EOS is not EOL */
-#define REG_STARTEND	0004	/* backward compatibility kludge */
 #define REG_FTRACE	0010		/* none of your business */
 #define REG_MTRACE	0020		/* none of your business */
 #define REG_SMALL	0040		/* none of your business */
diff --git a/src/test/regress/.gitignore b/src/test/regress/.gitignore
index 173f995d24..89129d7358 100644
--- a/src/test/regress/.gitignore
+++ b/src/test/regress/.gitignore
@@ -6,6 +6,6 @@
 /results/
 /log/
 
-# Note: regreesion.* are only left behind on a failure; that's why they're not ignored
+# Note: regression.* are only left behind on a failure; that's why they're not ignored
 #/regression.diffs
 #/regression.out
