Hello hackers,

Please consider fixing the next bunch of typos and inconsistencies in
the tree:
4.1. AccesShareLock -> AccessShareLock
4.2. AdjustTimestampForTypemod -> AdjustTimestampForTypmod
4.3. AExprConst -> AexprConst
4.4. AlterExtensionOwner_oid - remove (orphaned after 994c36e0)
4.5. AlterTableDropColumn -> ATExecDropColumn (renamed in 077db40f)
4.6. ApplySortComparatorFull -> ApplySortAbbrevFullComparator
4.7. arracontjoinsel -> arraycontjoinsel
4.8. ArrayNItems -> ArrayGetNItems
4.9. ArrayRef -> SubscriptingRef (renamed by 558d77f2)
4.10. AtPrepare_Inval - remove (orphaned after efc16ea52)

4.11. AttributeOffsetGetAttributeNumber - > AttrOffsetGetAttrNumber
4.12. AttInMetaData -> AttInMetadata
4.13. AuthenticationMD5 -> AuthenticationMD5Password (for the sake of
consistency with the docs)
4.14. AUTH_REQ_GSSAPI -> AUTH_REQ_GSS
4.15. autogened -> autogenerated
4.16. BarrierWait -> BarrierArriveAndWait()
4.17. bgprocno -> bgwprocno
4.18. BGW_NVER_RESTART -> BGW_NEVER_RESTART
4.19. BloomInitBuffer -> BloomInitPage
4.20. br_deconstruct_tuple -> brin_deconstruct_tuple

4.21. brin_tuples.c -> brin_tuple.c
4.22. bt_parallel_done -> _bt_parallel_done
4.23. bt_parallel_release -> _bt_parallel_release
4.24. btree_insert_redo -> btree_xlog_insert
4.25. bucket_has_garbage -> split_cleanup
4.26. byta -> bytea
4.27. CachePlan -> CachedPlan
4.28. CheckBufferLeaks -> CheckForBufferLeaks
4.29. check_for_free_segments -> check_for_freed_segments
4.30. chunkbit -> schunkbit

4.31. cking -> remove (the comment is old and irrelevant since PG95-1_01)
4.32. ClearPgTM -> ClearPgTm
4.33. close_ - > closept_
4.34. CloseTransient File -> CloseTransientFile
4.35. colorTrigramsGroups -> colorTrigramGroups
4.36. combinedproj -> remove (orphaned after 69c3936a)
4.37. contigous_pages -> contiguous_pages
4.38. cookies_len -> cookies_size
4.39. cost_tableexprscan -> remove (not used since introduction in fcec6caa)
4.40. create_custom_plan -> create_customscan_plan

4.41. CreateInitialDecodingContext -> CreateInitDecodingContext
4.42. CreateSlot -> CreateSlotOnDisk
4.43. create_tablexprscan_path -> remove (not used since introduction in
fcec6caa)
4.44. crypt_des -> px_crypt_des
4.45. ctrigOid -> trigOid
4.46. curCollations -> colCollations
4.47. cur_mem & prev_mem -> cur_em & prev_em
4.48. customer_id_indexdex -> customer_id_index
4.49. custom_scan -> cscan

I've split proposed patch to make the fixes checking simpler.

Best regards,
Alexander
diff --git a/contrib/bloom/blutils.c b/contrib/bloom/blutils.c
index ee3bd56274..cc1670934f 100644
--- a/contrib/bloom/blutils.c
+++ b/contrib/bloom/blutils.c
@@ -341,7 +341,7 @@ BloomPageAddItem(BloomState *state, Page page, BloomTuple *tuple)
 /*
  * Allocate a new page (either by recycling, or by extending the index file)
  * The returned buffer is already pinned and exclusive-locked
- * Caller is responsible for initializing the page by calling BloomInitBuffer
+ * Caller is responsible for initializing the page by calling BloomInitPage
  */
 Buffer
 BloomNewBuffer(Relation index)
diff --git a/src/backend/access/brin/brin_tuple.c b/src/backend/access/brin/brin_tuple.c
index 5abb472ee4..7e9e73d2cf 100644
--- a/src/backend/access/brin/brin_tuple.c
+++ b/src/backend/access/brin/brin_tuple.c
@@ -207,7 +207,7 @@ brin_form_tuple(BrinDesc *brdesc, BlockNumber blkno, BrinMemTuple *tuple,
 		/*
 		 * Note that we reverse the sense of null bits in this module: we
 		 * store a 1 for a null attribute rather than a 0.  So we must reverse
-		 * the sense of the att_isnull test in br_deconstruct_tuple as well.
+		 * the sense of the att_isnull test in brin_deconstruct_tuple as well.
 		 */
 		bitP = ((bits8 *) ((char *) rettuple + SizeOfBrinTuple)) - 1;
 		bitmask = HIGHBIT;
diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c
index f5db5a8c4a..b66b517aca 100644
--- a/src/backend/postmaster/bgworker.c
+++ b/src/backend/postmaster/bgworker.c
@@ -525,7 +525,7 @@ ResetBackgroundWorkerCrashTimes(void)
 		if (rw->rw_worker.bgw_restart_time == BGW_NEVER_RESTART)
 		{
 			/*
-			 * Workers marked BGW_NVER_RESTART shouldn't get relaunched after
+			 * Workers marked BGW_NEVER_RESTART shouldn't get relaunched after
 			 * the crash, so forget about them.  (If we wait until after the
 			 * crash to forget about them, and they are parallel workers,
 			 * parallel_terminate_count will get incremented after we've
diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c
index 06659ab265..c8d4e6f9e4 100644
--- a/src/backend/storage/buffer/freelist.c
+++ b/src/backend/storage/buffer/freelist.c
@@ -220,7 +220,7 @@ StrategyGetBuffer(BufferAccessStrategy strategy, uint32 *buf_state)
 	 * If asked, we need to waken the bgwriter. Since we don't want to rely on
 	 * a spinlock for this we force a read from shared memory once, and then
 	 * set the latch based on that value. We need to go through that length
-	 * because otherwise bgprocno might be reset while/after we check because
+	 * because otherwise bgwprocno might be reset while/after we check because
 	 * the compiler might just reread from memory.
 	 *
 	 * This can possibly set the latch of the wrong process if the bgwriter
diff --git a/src/backend/storage/ipc/barrier.c b/src/backend/storage/ipc/barrier.c
index 69ed034e52..83cbe33107 100644
--- a/src/backend/storage/ipc/barrier.c
+++ b/src/backend/storage/ipc/barrier.c
@@ -226,9 +226,9 @@ BarrierAttach(Barrier *barrier)
 }
 
 /*
- * Detach from a barrier.  This may release other waiters from BarrierWait and
- * advance the phase if they were only waiting for this backend.  Return true
- * if this participant was the last to detach.
+ * Detach from a barrier.  This may release other waiters from
+ * BarrierArriveAndWait() and advance the phase if they were only waiting for
+ * this backend.  Return true if this participant was the last to detach.
  */
 bool
 BarrierDetach(Barrier *barrier)
diff --git a/src/backend/utils/Gen_dummy_probes.pl b/src/backend/utils/Gen_dummy_probes.pl
index a662775cc1..a4b58ad69f 100644
--- a/src/backend/utils/Gen_dummy_probes.pl
+++ b/src/backend/utils/Gen_dummy_probes.pl
@@ -14,7 +14,7 @@
 #
 #-------------------------------------------------------------------------
 
-# turn off perlcritic for autogened code
+# turn off perlcritic for autogenerated code
 ## no critic
 
 $0 =~ s/^.*?(\w+)[\.\w+]*$/$1/;
diff --git a/src/include/access/attnum.h b/src/include/access/attnum.h
index f16441a587..093eee86c6 100644
--- a/src/include/access/attnum.h
+++ b/src/include/access/attnum.h
@@ -55,7 +55,7 @@ typedef int16 AttrNumber;
 )
 
 /*
- * AttributeOffsetGetAttributeNumber
+ * AttrOffsetGetAttrNumber
  *		Returns the attribute number for an attribute offset.
  */
 #define AttrOffsetGetAttrNumber(attributeOffset) \
diff --git a/src/include/funcapi.h b/src/include/funcapi.h
index ebba8b6f54..1a88b52087 100644
--- a/src/include/funcapi.h
+++ b/src/include/funcapi.h
@@ -252,7 +252,7 @@ extern Datum HeapTupleHeaderGetDatum(HeapTupleHeader tuple);
  *		oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
  *		<user defined code>
  *		<if returning composite>
- *			<build TupleDesc, and perhaps AttInMetaData>
+ *			<build TupleDesc, and perhaps AttInMetadata>
  *		<endif returning composite>
  *		<user defined code>
  *		// return to original context when allocating transient memory
diff --git a/src/interfaces/libpq/fe-auth.c b/src/interfaces/libpq/fe-auth.c
index bb04e27e2f..ab227421b3 100644
--- a/src/interfaces/libpq/fe-auth.c
+++ b/src/interfaces/libpq/fe-auth.c
@@ -717,7 +717,7 @@ pg_password_sendauth(PGconn *conn, const char *password, AuthRequest areq)
 	const char *pwd_to_send;
 	char		md5Salt[4];
 
-	/* Read the salt from the AuthenticationMD5 message. */
+	/* Read the salt from the AuthenticationMD5Password message. */
 	if (areq == AUTH_REQ_MD5)
 	{
 		if (pqGetnchar(md5Salt, 4, conn))
@@ -897,7 +897,7 @@ pg_fe_sendauth(AuthRequest areq, int payloadlen, PGconn *conn)
 			/*
 			 * No SSPI support. However, if we have GSSAPI but not SSPI
 			 * support, AUTH_REQ_SSPI will have been handled in the codepath
-			 * for AUTH_REQ_GSSAPI above, so don't duplicate the case label in
+			 * for AUTH_REQ_GSS above, so don't duplicate the case label in
 			 * that case.
 			 */
 #if !defined(ENABLE_GSS)
diff --git a/src/backend/access/brin/brin_tuple.c b/src/backend/access/brin/brin_tuple.c
index 5abb472ee4..427870ac03 100644
--- a/src/backend/access/brin/brin_tuple.c
+++ b/src/backend/access/brin/brin_tuple.c
@@ -1,5 +1,5 @@
 /*
- * brin_tuples.c
+ * brin_tuple.c
  *		Method implementations for tuples in BRIN indexes.
  *
  * Intended usage is that code outside this file only deals with
diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c
index 85e54ac44b..4cfd5289ad 100644
--- a/src/backend/access/nbtree/nbtree.c
+++ b/src/backend/access/nbtree/nbtree.c
@@ -621,8 +621,8 @@ btparallelrescan(IndexScanDesc scan)
 
 /*
  * _bt_parallel_seize() -- Begin the process of advancing the scan to a new
- *		page.  Other scans must wait until we call bt_parallel_release() or
- *		bt_parallel_done().
+ *		page.  Other scans must wait until we call _bt_parallel_release()
+ *		or _bt_parallel_done().
  *
  * The return value is true if we successfully seized the scan and false
  * if we did not.  The latter case occurs if no pages remain for the current
diff --git a/src/backend/access/nbtree/nbtxlog.c b/src/backend/access/nbtree/nbtxlog.c
index 6532a25d3d..3147ea4726 100644
--- a/src/backend/access/nbtree/nbtxlog.c
+++ b/src/backend/access/nbtree/nbtxlog.c
@@ -181,7 +181,7 @@ btree_xlog_insert(bool isleaf, bool ismeta, XLogReaderState *record)
 
 		if (PageAddItem(page, (Item) datapos, datalen, xlrec->offnum,
 						false, false) == InvalidOffsetNumber)
-			elog(PANIC, "btree_insert_redo: failed to add item");
+			elog(PANIC, "btree_xlog_insert: failed to add item");
 
 		PageSetLSN(page, lsn);
 		MarkBufferDirty(buffer);
diff --git a/src/backend/nodes/tidbitmap.c b/src/backend/nodes/tidbitmap.c
index 9b913feb89..bf53459996 100644
--- a/src/backend/nodes/tidbitmap.c
+++ b/src/backend/nodes/tidbitmap.c
@@ -934,7 +934,7 @@ tbm_extract_page_tuple(PagetableEntry *page, TBMIterateResult *output)
 }
 
 /*
- *	tbm_advance_schunkbit - Advance the chunkbit
+ *	tbm_advance_schunkbit - Advance the schunkbit
  */
 static inline void
 tbm_advance_schunkbit(PagetableEntry *chunk, int *schunkbitp)
diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c
index c462ea82a9..391b6d6e16 100644
--- a/src/backend/storage/buffer/localbuf.c
+++ b/src/backend/storage/buffer/localbuf.c
@@ -537,7 +537,7 @@ GetLocalBufferStorage(void)
 /*
  * CheckForLocalBufferLeaks - ensure this backend holds no local buffer pins
  *
- * This is just like CheckBufferLeaks(), but for local buffers.
+ * This is just like CheckForBufferLeaks(), but for local buffers.
  */
 static void
 CheckForLocalBufferLeaks(void)
diff --git a/src/backend/utils/adt/oracle_compat.c b/src/backend/utils/adt/oracle_compat.c
index f78f5cda53..0fdfee5825 100644
--- a/src/backend/utils/adt/oracle_compat.c
+++ b/src/backend/utils/adt/oracle_compat.c
@@ -527,7 +527,7 @@ dotrim(const char *string, int stringlen,
  *
  * Syntax:
  *
- *	 bytea byteatrim(byta string, bytea set)
+ *	 bytea byteatrim(bytea string, bytea set)
  *
  * Purpose:
  *
diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c
index 4c114439cf..abc3062892 100644
--- a/src/backend/utils/cache/plancache.c
+++ b/src/backend/utils/cache/plancache.c
@@ -504,7 +504,7 @@ DropCachedPlan(CachedPlanSource *plansource)
 		plansource->is_saved = false;
 	}
 
-	/* Decrement generic CachePlan's refcount and drop if no longer needed */
+	/* Decrement generic CachedPlan's refcount and drop if no longer needed */
 	ReleaseGenericPlan(plansource);
 
 	/* Mark it no longer valid */
diff --git a/src/backend/utils/mmgr/dsa.c b/src/backend/utils/mmgr/dsa.c
index 4b826cdaa5..900cd8357c 100644
--- a/src/backend/utils/mmgr/dsa.c
+++ b/src/backend/utils/mmgr/dsa.c
@@ -2258,7 +2258,7 @@ check_for_freed_segments(dsa_area *area)
 }
 
 /*
- * Workhorse for check_for_free_segments(), and also used directly in path
+ * Workhorse for check_for_freed_segments(), and also used directly in path
  * where the area lock is already held.  This should be called after acquiring
  * the lock but before looking up any segment by index number, to make sure we
  * unmap any stale segments that might have previously had the same index as a
diff --git a/src/include/access/hash.h b/src/include/access/hash.h
index 210351863e..107c3d01ae 100644
--- a/src/include/access/hash.h
+++ b/src/include/access/hash.h
@@ -457,7 +457,7 @@ extern void hashbucketcleanup(Relation rel, Bucket cur_bucket,
 							  BufferAccessStrategy bstrategy,
 							  uint32 maxbucket, uint32 highmask, uint32 lowmask,
 							  double *tuples_removed, double *num_index_tuples,
-							  bool bucket_has_garbage,
+							  bool split_cleanup,
 							  IndexBulkDeleteCallback callback, void *callback_state);
 
 #endif							/* HASH_H */
diff --git a/contrib/pg_trgm/trgm_regexp.c b/contrib/pg_trgm/trgm_regexp.c
index 9ee8a54a8d..b16697d09f 100644
--- a/contrib/pg_trgm/trgm_regexp.c
+++ b/contrib/pg_trgm/trgm_regexp.c
@@ -441,7 +441,7 @@ typedef struct
 struct TrgmPackedGraph
 {
 	/*
-	 * colorTrigramsCount and colorTrigramsGroups contain information about
+	 * colorTrigramsCount and colorTrigramGroups contain information about
 	 * how trigrams are grouped into color trigrams.  "colorTrigramsCount" is
 	 * the count of color trigrams and "colorTrigramGroups" contains number of
 	 * simple trigrams for each color trigram.  The array of simple trigrams
diff --git a/src/backend/libpq/be-fsstubs.c b/src/backend/libpq/be-fsstubs.c
index 68f83a9bfd..97add3f257 100644
--- a/src/backend/libpq/be-fsstubs.c
+++ b/src/backend/libpq/be-fsstubs.c
@@ -62,7 +62,7 @@
  * A non-null entry is a pointer to a LargeObjectDesc allocated in the
  * LO private memory context "fscxt".  The cookies array itself is also
  * dynamically allocated in that context.  Its current allocated size is
- * cookies_len entries, of which any unused entries will be NULL.
+ * cookies_size entries, of which any unused entries will be NULL.
  */
 static LargeObjectDesc **cookies = NULL;
 static int	cookies_size = 0;
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index 608d5adfed..12fba56285 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -3911,7 +3911,7 @@ create_foreignscan_plan(PlannerInfo *root, ForeignPath *best_path,
 }
 
 /*
- * create_custom_plan
+ * create_customscan_plan
  *
  * Transform a CustomPath into a Plan.
  */
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index e9add385ba..54ea69f7f1 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -3029,7 +3029,7 @@ DecodeSpecial(int field, char *lowtoken, int *val)
 }
 
 
-/* ClearPgTM
+/* ClearPgTm
  *
  * Zero out a pg_tm and associated fsec_t
  */
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index 373784fcc1..0fd7dae658 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -2586,7 +2586,7 @@ lseg_interpt_line(Point *result, LSEG *lseg, LINE *line)
 }
 
 /*---------------------------------------------------------------------
- *		close_
+ *		closept_
  *				Point of closest proximity between objects.
  *-------------------------------------------------------------------*/
 
diff --git a/src/backend/utils/mmgr/freepage.c b/src/backend/utils/mmgr/freepage.c
index 0c9e98973a..9a1ae13ab1 100644
--- a/src/backend/utils/mmgr/freepage.c
+++ b/src/backend/utils/mmgr/freepage.c
@@ -231,7 +231,7 @@ FreePageManagerGet(FreePageManager *fpm, Size npages, Size *first_page)
 
 	/*
 	 * FreePageManagerGetInternal may have set contiguous_pages_dirty.
-	 * Recompute contigous_pages if so.
+	 * Recompute contiguous_pages if so.
 	 */
 	FreePageManagerUpdateLargest(fpm);
 
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 99b9fa414f..385ae90bb8 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -2031,7 +2031,6 @@ typedef struct AggState
 #define FIELDNO_AGGSTATE_ALL_PERGROUPS 34
 	AggStatePerGroup *all_pergroups;	/* array of first ->pergroups, than
 										 * ->hash_pergroup */
-	ProjectionInfo *combinedproj;	/* projection machinery */
 } AggState;
 
 /* ----------------
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
index 9b6bdbc518..b3d0b4f6fb 100644
--- a/src/include/optimizer/cost.h
+++ b/src/include/optimizer/cost.h
@@ -86,8 +86,6 @@ extern void cost_subqueryscan(SubqueryScanPath *path, PlannerInfo *root,
 							  RelOptInfo *baserel, ParamPathInfo *param_info);
 extern void cost_functionscan(Path *path, PlannerInfo *root,
 							  RelOptInfo *baserel, ParamPathInfo *param_info);
-extern void cost_tableexprscan(Path *path, PlannerInfo *root,
-							   RelOptInfo *baserel, ParamPathInfo *param_info);
 extern void cost_valuesscan(Path *path, PlannerInfo *root,
 							RelOptInfo *baserel, ParamPathInfo *param_info);
 extern void cost_tablefuncscan(Path *path, PlannerInfo *root,
diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h
index 9959258d7d..d2a8c52044 100644
--- a/src/include/storage/fd.h
+++ b/src/include/storage/fd.h
@@ -33,7 +33,7 @@
  * no way for them to share kernel file descriptors with other files.
  *
  * Likewise, use AllocateDir/FreeDir, not opendir/closedir, to allocate
- * open directories (DIR*), and OpenTransientFile/CloseTransient File for an
+ * open directories (DIR*), and OpenTransientFile/CloseTransientFile for an
  * unbuffered file descriptor.
  */
 #ifndef FD_H
diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h
index 8dcfb40728..ec21f7e45c 100644
--- a/src/include/tcop/tcopprot.h
+++ b/src/include/tcop/tcopprot.h
@@ -9,11 +9,6 @@
  *
  * src/include/tcop/tcopprot.h
  *
- * OLD COMMENTS
- *	  This file was created so that other c files could get the two
- *	  function prototypes without having to include tcop.h which single
- *	  handedly includes the whole f*cking tree -- mer 5 Nov. 1991
- *
  *-------------------------------------------------------------------------
  */
 #ifndef TCOPPROT_H
diff --git a/contrib/pgcrypto/crypt-des.c b/contrib/pgcrypto/crypt-des.c
index ed07fc4606..6efaa609c9 100644
--- a/contrib/pgcrypto/crypt-des.c
+++ b/contrib/pgcrypto/crypt-des.c
@@ -11,7 +11,7 @@
  *	binaries of libcrypt exportable from the USA
  *
  * Adapted for FreeBSD-4.0 by Mark R V Murray
- *	this file should now *only* export crypt_des(), in order to make
+ *	this file should now *only* export px_crypt_des(), in order to make
  *	a module that can be optionally included in libcrypt.
  *
  * Redistribution and use in source and binary forms, with or without
diff --git a/doc/src/sgml/diskusage.sgml b/doc/src/sgml/diskusage.sgml
index 3708e5f3d8..e6f0b307ec 100644
--- a/doc/src/sgml/diskusage.sgml
+++ b/doc/src/sgml/diskusage.sgml
@@ -89,7 +89,7 @@ ORDER BY c2.relname;
 
        relname        | relpages
 ----------------------+----------
- customer_id_indexdex |       26
+ customer_id_index    |       26
 </programlisting>
   </para>
 
diff --git a/src/backend/optimizer/path/equivclass.c b/src/backend/optimizer/path/equivclass.c
index b50e9ccdf1..05bd3750e5 100644
--- a/src/backend/optimizer/path/equivclass.c
+++ b/src/backend/optimizer/path/equivclass.c
@@ -929,7 +929,7 @@ generate_base_implied_equalities_no_const(PlannerInfo *root,
 	/*
 	 * We scan the EC members once and track the last-seen member for each
 	 * base relation.  When we see another member of the same base relation,
-	 * we generate "prev_mem = cur_mem".  This results in the minimum number
+	 * we generate "prev_em = cur_em".  This results in the minimum number
 	 * of derived clauses, but it's possible that it will fail when a
 	 * different ordering would succeed.  XXX FIXME: use a UNION-FIND
 	 * algorithm similar to the way we build merged ECs.  (Use a list-of-lists
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index b13c246183..345a8e6197 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -2082,7 +2082,7 @@ transformSetOperationTree(ParseState *pstate, SelectStmt *stmt,
 			 * Select common collation.  A common collation is required for
 			 * all set operators except UNION ALL; see SQL:2008 7.13 <query
 			 * expression> Syntax Rule 15c.  (If we fail to identify a common
-			 * collation for a UNION ALL column, the curCollations element
+			 * collation for a UNION ALL column, the colCollations element
 			 * will be set to InvalidOid, which may result in a runtime error
 			 * if something at a higher query level wants to use the column's
 			 * collation.)
diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c
index bbd38c06d1..9853be6d1c 100644
--- a/src/backend/replication/logical/logical.c
+++ b/src/backend/replication/logical/logical.c
@@ -114,7 +114,7 @@ CheckLogicalDecodingRequirements(void)
 }
 
 /*
- * Helper function for CreateInitialDecodingContext() and
+ * Helper function for CreateInitDecodingContext() and
  * CreateDecodingContext() performing common tasks.
  */
 static LogicalDecodingContext *
diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index 55c306e465..33fb0a4865 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -1334,7 +1334,7 @@ SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel)
 		return;
 	}
 
-	/* Check CreateSlot() for the reasoning of using a crit. section. */
+	/* Check CreateSlotOnDisk() for the reasoning of using a crit. section. */
 	START_CRIT_SECTION();
 
 	fsync_fname(path, false);
diff --git a/src/include/commands/event_trigger.h b/src/include/commands/event_trigger.h
index fd977e7735..575e9243e5 100644
--- a/src/include/commands/event_trigger.h
+++ b/src/include/commands/event_trigger.h
@@ -40,7 +40,7 @@ typedef struct EventTriggerData
 	((fcinfo)->context != NULL && IsA((fcinfo)->context, EventTriggerData))
 
 extern Oid	CreateEventTrigger(CreateEventTrigStmt *stmt);
-extern void RemoveEventTriggerById(Oid ctrigOid);
+extern void RemoveEventTriggerById(Oid trigOid);
 extern Oid	get_event_trigger_oid(const char *trigname, bool missing_ok);
 
 extern Oid	AlterEventTrigger(AlterEventTrigStmt *stmt);
diff --git a/src/include/executor/nodeCustom.h b/src/include/executor/nodeCustom.h
index 2c9cb95d82..2829be5d01 100644
--- a/src/include/executor/nodeCustom.h
+++ b/src/include/executor/nodeCustom.h
@@ -18,7 +18,7 @@
 /*
  * General executor code
  */
-extern CustomScanState *ExecInitCustomScan(CustomScan *custom_scan,
+extern CustomScanState *ExecInitCustomScan(CustomScan *cscan,
 										   EState *estate, int eflags);
 extern void ExecEndCustomScan(CustomScanState *node);
 
diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h
index e70d6a3f18..182ffeef4b 100644
--- a/src/include/optimizer/pathnode.h
+++ b/src/include/optimizer/pathnode.h
@@ -96,8 +96,6 @@ extern SubqueryScanPath *create_subqueryscan_path(PlannerInfo *root,
 												  List *pathkeys, Relids required_outer);
 extern Path *create_functionscan_path(PlannerInfo *root, RelOptInfo *rel,
 									  List *pathkeys, Relids required_outer);
-extern Path *create_tablexprscan_path(PlannerInfo *root, RelOptInfo *rel,
-									  List *pathkeys, Relids required_outer);
 extern Path *create_valuesscan_path(PlannerInfo *root, RelOptInfo *rel,
 									Relids required_outer);
 extern Path *create_tablefuncscan_path(PlannerInfo *root, RelOptInfo *rel,
diff --git a/contrib/intarray/_int_selfuncs.c b/contrib/intarray/_int_selfuncs.c
index b3e63df72c..aebffae66c 100644
--- a/contrib/intarray/_int_selfuncs.c
+++ b/contrib/intarray/_int_selfuncs.c
@@ -43,7 +43,7 @@ static int	compare_val_int4(const void *a, const void *b);
  *
  * The default array selectivity operators for the @>, && and @< operators
  * work fine for integer arrays. However, if we tried to just use arraycontsel
- * and arracontjoinsel directly as the cost estimator functions for our
+ * and arraycontjoinsel directly as the cost estimator functions for our
  * operators, they would not work as intended, because they look at the
  * operator's OID. Our operators behave exactly like the built-in anyarray
  * versions, but we must tell the cost estimator functions which built-in
diff --git a/contrib/postgres_fdw/expected/postgres_fdw.out b/contrib/postgres_fdw/expected/postgres_fdw.out
index b2050d1b6f..f0c842a607 100644
--- a/contrib/postgres_fdw/expected/postgres_fdw.out
+++ b/contrib/postgres_fdw/expected/postgres_fdw.out
@@ -665,7 +665,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = ANY(ARRAY[c2, 1, c1
    Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = ANY (ARRAY[c2, 1, ("C 1" + 0)])))
 (3 rows)
 
-EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = (ARRAY[c1,c2,3])[1]; -- ArrayRef
+EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = (ARRAY[c1,c2,3])[1]; -- SubscriptingRef
                                                       QUERY PLAN                                                      
 ----------------------------------------------------------------------------------------------------------------------
  Foreign Scan on public.ft1 t1
diff --git a/contrib/postgres_fdw/sql/postgres_fdw.sql b/contrib/postgres_fdw/sql/postgres_fdw.sql
index 2a8e6c7b28..630b803e26 100644
--- a/contrib/postgres_fdw/sql/postgres_fdw.sql
+++ b/contrib/postgres_fdw/sql/postgres_fdw.sql
@@ -297,7 +297,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = -c1;          -- Op
 EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE 1 = c1!;           -- OpExpr(r)
 EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE (c1 IS NOT NULL) IS DISTINCT FROM (c1 IS NOT NULL); -- DistinctExpr
 EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = ANY(ARRAY[c2, 1, c1 + 0]); -- ScalarArrayOpExpr
-EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = (ARRAY[c1,c2,3])[1]; -- ArrayRef
+EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = (ARRAY[c1,c2,3])[1]; -- SubscriptingRef
 EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c6 = E'foo''s\\bar';  -- check special chars
 EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c8 = 'foo';  -- can't be sent to remote
 -- parameterized remote path for foreign table
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 86820eecfc..292b2c39cf 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -1588,7 +1588,7 @@ RemoveAttributeById(Oid relid, AttrNumber attnum)
 	/*
 	 * Grab an exclusive lock on the target table, which we will NOT release
 	 * until end of transaction.  (In the simple case where we are directly
-	 * dropping this column, AlterTableDropColumn already did this ... but
+	 * dropping this column, ATExecDropColumn already did this ... but
 	 * when cascading from a drop of some other object, we may not have any
 	 * lock.)
 	 */
diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c
index e4a6c20ed0..e4e05753ee 100644
--- a/src/backend/executor/execExpr.c
+++ b/src/backend/executor/execExpr.c
@@ -1200,12 +1200,12 @@ ExecInitExprRec(Expr *node, ExprState *state,
 					 * field's values[]/nulls[] entries as both the caseval
 					 * source and the result address for this subexpression.
 					 * That's okay only because (1) both FieldStore and
-					 * ArrayRef evaluate their arg or refexpr inputs first,
-					 * and (2) any such CaseTestExpr is directly the arg or
-					 * refexpr input.  So any read of the caseval will occur
-					 * before there's a chance to overwrite it.  Also, if
-					 * multiple entries in the newvals/fieldnums lists target
-					 * the same field, they'll effectively be applied
+					 * SubscriptingRef evaluate their arg or refexpr inputs
+					 * first, and (2) any such CaseTestExpr is directly the
+					 * arg or refexpr input.  So any read of the caseval will
+					 * occur before there's a chance to overwrite it.  Also,
+					 * if multiple entries in the newvals/fieldnums lists
+					 * target the same field, they'll effectively be applied
 					 * left-to-right which is what we want.
 					 */
 					save_innermost_caseval = state->innermost_caseval;
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
index 2e84d6b3b4..d78f4e64c1 100644
--- a/src/backend/optimizer/util/clauses.c
+++ b/src/backend/optimizer/util/clauses.c
@@ -3409,10 +3409,10 @@ eval_const_expressions_mutator(Node *node,
 			{
 				/*
 				 * This case could be folded into the generic handling used
-				 * for ArrayRef etc.  But because the simplification logic is
-				 * so trivial, applying evaluate_expr() to perform it would be
-				 * a heavy overhead.  BooleanTest is probably common enough to
-				 * justify keeping this bespoke implementation.
+				 * for SubscriptingRef etc.  But because the simplification
+				 * logic is so trivial, applying evaluate_expr() to perform it
+				 * would be a heavy overhead.  BooleanTest is probably common
+				 * enough to justify keeping this bespoke implementation.
 				 */
 				BooleanTest *btest = (BooleanTest *) node;
 				BooleanTest *newbtest;
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 8311b1dd46..208b4a1f28 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -12542,7 +12542,7 @@ SimpleTypename:
  * Note that ConstInterval is not included here since it must
  * be pushed up higher in the rules to accommodate the postfix
  * options (e.g. INTERVAL '1' YEAR). Likewise, we have to handle
- * the generic-type-name case in AExprConst to avoid premature
+ * the generic-type-name case in AexprConst to avoid premature
  * reduce/reduce conflicts against function names.
  */
 ConstTypename:
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c
index ba470366e1..b70d92b955 100644
--- a/src/backend/parser/parse_target.c
+++ b/src/backend/parser/parse_target.c
@@ -695,9 +695,9 @@ transformAssignmentIndirection(ParseState *pstate,
 		/*
 		 * Set up a substitution.  We abuse CaseTestExpr for this.  It's safe
 		 * to do so because the only nodes that will be above the CaseTestExpr
-		 * in the finished expression will be FieldStore and ArrayRef nodes.
-		 * (There could be other stuff in the tree, but it will be within
-		 * other child fields of those node types.)
+		 * in the finished expression will be FieldStore and SubscriptingRef
+		 * nodes. (There could be other stuff in the tree, but it will be
+		 * within other child fields of those node types.)
 		 */
 		CaseTestExpr *ctest = makeNode(CaseTestExpr);
 
diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c
index ea40c28733..5b047d1662 100644
--- a/src/backend/rewrite/rewriteHandler.c
+++ b/src/backend/rewrite/rewriteHandler.c
@@ -980,11 +980,11 @@ process_matched_tle(TargetEntry *src_tle,
 	 *
 	 * As a further complication, the destination column might be a domain,
 	 * resulting in each assignment containing a CoerceToDomain node over a
-	 * FieldStore or ArrayRef.  These should have matching target domains,
-	 * so we strip them and reconstitute a single CoerceToDomain over the
-	 * combined FieldStore/ArrayRef nodes.  (Notice that this has the result
-	 * that the domain's checks are applied only after we do all the field or
-	 * element updates, not after each one.  This is arguably desirable.)
+	 * FieldStore or SubscriptingRef.  These should have matching target
+	 * domains, so we strip them and reconstitute a single CoerceToDomain over
+	 * the combined FieldStore/SubscriptingRef nodes.  (Notice that this has the
+	 * result that the domain's checks are applied only after we do all the
+	 * field or element updates, not after each one.  This is arguably desirable.)
 	 *----------
 	 */
 	src_expr = (Node *) src_tle->expr;
diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c
index 3ae1556246..ad3f02a383 100644
--- a/src/backend/utils/adt/arrayfuncs.c
+++ b/src/backend/utils/adt/arrayfuncs.c
@@ -1322,7 +1322,7 @@ array_recv(PG_FUNCTION_ARGS)
 		lBound[i] = pq_getmsgint(buf, 4);
 
 		/*
-		 * Check overflow of upper bound. (ArrayNItems() below checks that
+		 * Check overflow of upper bound. (ArrayGetNItems() below checks that
 		 * dim[i] >= 0)
 		 */
 		if (dim[i] != 0)
diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c
index e440a4fedd..4b1afb10f9 100644
--- a/src/backend/utils/adt/date.c
+++ b/src/backend/utils/adt/date.c
@@ -1374,7 +1374,7 @@ time_scale(PG_FUNCTION_ARGS)
 
 /* AdjustTimeForTypmod()
  * Force the precision of the time value to a specified value.
- * Uses *exactly* the same code as in AdjustTimestampForTypemod()
+ * Uses *exactly* the same code as in AdjustTimestampForTypmod()
  * but we make a separate copy because those types do not
  * have a fundamental tie together but rather a coincidence of
  * implementation. - thomas
diff --git a/src/include/commands/extension.h b/src/include/commands/extension.h
index 923f8530b4..c724430aec 100644
--- a/src/include/commands/extension.h
+++ b/src/include/commands/extension.h
@@ -51,6 +51,4 @@ extern char *get_extension_name(Oid ext_oid);
 extern ObjectAddress AlterExtensionNamespace(const char *extensionName, const char *newschema,
 											 Oid *oldschema);
 
-extern void AlterExtensionOwner_oid(Oid extensionOid, Oid newOwnerId);
-
 #endif							/* EXTENSION_H */
diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h
index 7c278c0e56..860a84de7c 100644
--- a/src/include/nodes/primnodes.h
+++ b/src/include/nodes/primnodes.h
@@ -940,7 +940,7 @@ typedef struct CaseWhen
  * We also abuse this node type for some other purposes, including:
  *	* Placeholder for the current array element value in ArrayCoerceExpr;
  *	  see build_coercion_expression().
- *	* Nested FieldStore/ArrayRef assignment expressions in INSERT/UPDATE;
+ *	* Nested FieldStore/SubscriptingRef assignment expressions in INSERT/UPDATE;
  *	  see transformAssignmentIndirection().
  *
  * The uses in CaseExpr and ArrayCoerceExpr are safe only to the extent that
@@ -950,7 +950,7 @@ typedef struct CaseWhen
  * break it.
  *
  * The nested-assignment-expression case is safe because the only node types
- * that can be above such CaseTestExprs are FieldStore and ArrayRef.
+ * that can be above such CaseTestExprs are FieldStore and SubscriptingRef.
  */
 typedef struct CaseTestExpr
 {
diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h
index 1cee7db89d..ac7ee72952 100644
--- a/src/include/storage/proc.h
+++ b/src/include/storage/proc.h
@@ -63,7 +63,7 @@ struct XidCache
 	(PROC_IN_VACUUM | PROC_IN_ANALYZE | PROC_VACUUM_FOR_WRAPAROUND)
 
 /*
- * We allow a small number of "weak" relation locks (AccesShareLock,
+ * We allow a small number of "weak" relation locks (AccessShareLock,
  * RowShareLock, RowExclusiveLock) to be recorded in the PGPROC structure
  * rather than the main lock table.  This eases contention on the lock
  * manager LWLocks.  See storage/lmgr/README for additional details.
diff --git a/src/include/utils/inval.h b/src/include/utils/inval.h
index e7baa39d2a..940d53f900 100644
--- a/src/include/utils/inval.h
+++ b/src/include/utils/inval.h
@@ -29,8 +29,6 @@ extern void AtEOXact_Inval(bool isCommit);
 
 extern void AtEOSubXact_Inval(bool isCommit);
 
-extern void AtPrepare_Inval(void);
-
 extern void PostPrepare_Inval(void);
 
 extern void CommandEndInvalidationMessages(void);
diff --git a/src/include/utils/sortsupport.h b/src/include/utils/sortsupport.h
index 1eb89da3f7..997b7900a7 100644
--- a/src/include/utils/sortsupport.h
+++ b/src/include/utils/sortsupport.h
@@ -184,8 +184,8 @@ typedef struct SortSupportData
 	/*
 	 * Full, authoritative comparator for key that an abbreviated
 	 * representation was generated for, used when an abbreviated comparison
-	 * was inconclusive (by calling ApplySortComparatorFull()), or used to
-	 * replace "comparator" when core system ultimately decides against
+	 * was inconclusive (by calling ApplySortAbbrevFullComparator()), or used
+	 * to replace "comparator" when core system ultimately decides against
 	 * abbreviation.
 	 */
 	int			(*abbrev_full_comparator) (Datum x, Datum y, SortSupport ssup);

Reply via email to