diff --git a/src/backend/access/gin/README b/src/backend/access/gin/README
index 30c0867829..838fdc0d63 100644
--- a/src/backend/access/gin/README
+++ b/src/backend/access/gin/README
@@ -163,7 +163,7 @@ algorithms.
 
 * The posting list can be accessed with GinGetPosting(itup)
 
-* If GinITupIsCompressed(itup), the posting list is stored in compressed
+* If GinItupIsCompressed(itup), the posting list is stored in compressed
   format. Otherwise it is just an array of ItemPointers. New tuples are always
   stored in compressed format, uncompressed items can be present if the
   database was migrated from 9.3 or earlier version.
diff --git a/src/backend/access/gin/gindatapage.c b/src/backend/access/gin/gindatapage.c
index 57c3b830d8..ec26016a67 100644
--- a/src/backend/access/gin/gindatapage.c
+++ b/src/backend/access/gin/gindatapage.c
@@ -36,7 +36,7 @@
 #define GinPostingListSegmentMinSize 128
 
 /*
- * At least this many items fit in a GinPostingListSegmentMaxSize-bytes
+ * At least this many items fit in a GinPostingListSegmentMaxSize bytes
  * long segment. This is used when estimating how much space is required
  * for N items, at minimum.
  */
diff --git a/src/backend/access/gist/README b/src/backend/access/gist/README
index 84a4961d0c..8cbca69296 100644
--- a/src/backend/access/gist/README
+++ b/src/backend/access/gist/README
@@ -170,7 +170,7 @@ it splits the page, and constructs the new downlink tuples for the split
 pages. The caller must then call gistplacetopage() on the parent page to
 insert the downlink tuples. The parent page that holds the downlink to
 the child might have migrated as a result of concurrent splits of the
-parent, gistfindCorrectParent() is used to find the parent page.
+parent, gistFindCorrectParent() is used to find the parent page.
 
 Splitting the root page works slightly differently. At root split,
 gistplacetopage() allocates the new child pages and replaces the old root
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c
index 470b121e7d..dfb51f609d 100644
--- a/src/backend/access/gist/gist.c
+++ b/src/backend/access/gist/gist.c
@@ -821,7 +821,7 @@ gistdoinsert(Relation r, IndexTuple itup, Size freespace,
 			/*
 			 * Leaf page. Insert the new key. We've already updated all the
 			 * parents on the way down, but we might have to split the page if
-			 * it doesn't fit. gistinserthere() will take care of that.
+			 * it doesn't fit. gistinserttuple() will take care of that.
 			 */
 
 			/*
diff --git a/src/backend/parser/parse_agg.c b/src/backend/parser/parse_agg.c
index d50410d23a..dba6dec2cc 100644
--- a/src/backend/parser/parse_agg.c
+++ b/src/backend/parser/parse_agg.c
@@ -58,7 +58,7 @@ static int	check_agg_arguments(ParseState *pstate,
 static bool check_agg_arguments_walker(Node *node,
 									   check_agg_arguments_context *context);
 static void check_ungrouped_columns(Node *node, ParseState *pstate, Query *qry,
-									List *groupClauses, List *groupClauseVars,
+									List *groupClauses, List *groupClauseCommonVars,
 									bool have_non_var_grouping,
 									List **func_grouped_rels);
 static bool check_ungrouped_columns_walker(Node *node,
diff --git a/src/backend/storage/file/buffile.c b/src/backend/storage/file/buffile.c
index b773a76049..b40e6f3fde 100644
--- a/src/backend/storage/file/buffile.c
+++ b/src/backend/storage/file/buffile.c
@@ -664,7 +664,7 @@ BufFileSeek(BufFile *file, int fileno, off_t offset, int whence)
 
 			/*
 			 * Relative seek considers only the signed offset, ignoring
-			 * fileno. Note that large offsets (> 1 gig) risk overflow in this
+			 * fileno. Note that large offsets (> 1 GB) risk overflow in this
 			 * add, unless we have 64-bit off_t.
 			 */
 			newFile = file->curFile;
diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c
index 565c3ac439..7b6aa6c0be 100644
--- a/src/backend/storage/lmgr/predicate.c
+++ b/src/backend/storage/lmgr/predicate.c
@@ -3405,7 +3405,7 @@ ReleasePredicateLocks(bool isCommit, bool isReadOnlySafe)
 	 *
 	 * If this value is changing, we don't care that much whether we get the
 	 * old or new value -- it is just used to determine how far
-	 * GlobalSerializableXmin must advance before this transaction can be
+	 * SxactGlobalXmin must advance before this transaction can be
 	 * fully cleaned up.  The worst that could happen is we wait for one more
 	 * transaction to complete before freeing some RAM; correctness of visible
 	 * behavior is not affected.
diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h
index f80694bf9a..9e3958398e 100644
--- a/src/include/access/gist_private.h
+++ b/src/include/access/gist_private.h
@@ -400,7 +400,7 @@ extern void freeGISTstate(GISTSTATE *giststate);
 extern void gistdoinsert(Relation r,
 						 IndexTuple itup,
 						 Size freespace,
-						 GISTSTATE *GISTstate,
+						 GISTSTATE *giststate,
 						 Relation heapRel,
 						 bool is_build);
 
diff --git a/src/include/storage/predicate_internals.h b/src/include/storage/predicate_internals.h
index de7a846cf3..a1b981302d 100644
--- a/src/include/storage/predicate_internals.h
+++ b/src/include/storage/predicate_internals.h
@@ -52,7 +52,7 @@ typedef uint64 SerCommitSeqNo;
  *
  * Eligibility for cleanup of committed transactions is generally determined
  * by comparing the transaction's finishedBefore field to
- * SerializableGlobalXmin.
+ * SxactGlobalXmin.
  */
 typedef struct SERIALIZABLEXACT
 {
diff --git a/src/interfaces/ecpg/pgtypeslib/dt_common.c b/src/interfaces/ecpg/pgtypeslib/dt_common.c
index 4c2828db84..e71defaa66 100644
--- a/src/interfaces/ecpg/pgtypeslib/dt_common.c
+++ b/src/interfaces/ecpg/pgtypeslib/dt_common.c
@@ -172,7 +172,7 @@ static const datetkn datetktbl[] = {
 	ghst
 #endif
 	{"gilt", TZ, 43200},		/* Gilbert Islands Time */
-	{"gmt", TZ, 0},				/* Greenwish Mean Time */
+	{"gmt", TZ, 0},				/* Greenwich Mean Time */
 	{"gst", TZ, 36000},			/* Guam Std Time, USSR Zone 9 */
 	{"gyt", TZ, -14400},		/* Guyana Time */
 	{"h", UNITS, DTK_HOUR},		/* "hour" */
