Hello hackers,

Please consider fixing the next set of typos and inconsistencies in the
tree:
8.1. LABORT -> LIKE_ABORT
8.2. LagTrackerWriter -> LagTrackerWrite
8.3. lag_with_offset_and_default, * ->
window_lag_with_offset_and_default, window_* (in windowfuncs.c)
8.4. language-name -> language_name
8.5. lastOverflowedXID -> lastOverflowedXid
8.6. last_processed -> last_processing
8.7. last-query -> last_query
8.8. lastsysoid -> datlastsysoid
8.9. lastUsedPage -> lastUsedPages
8.10. lbv -> lbsv
8.11. leafSegment -> leafSegmentInfo
8.12. LibraryName/SymbolName -> remove (orphaned after f9143d10)
8.13. licence -> license
8.14. LINE_ALLOC -> remove (orphaned since 12ee6ec7)
8.15. local_ip_addr, local_port_addr -> remove and update a comment
(orphaned since b4cea00a)
8.16. local_passwd.c -> update a comment (see
http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/passwd/local_passwd.c.diff?r1=1.19&r2=1.20
)
8.17. localTransactionid -> localTransactionId
8.18. LocalTransactionID -> localTransactionId
8.19. LOCKDEF_H_ -> LOCKDEFS_H_
8.20. LOCK_H -> LOCK_H_
8.21. lockid -> lock
8.22. LOGICAL_PROTO_VERSION_NUM, PGLOGICAL_PROTO_MIN_VERSION_NUM ->
LOGICALREP_PROTO_VERSION_NUM, LOGICALREP_PROTO_MIN_VERSION_NUM
8.23. LOGICALREP_PROTO_H -> LOGICAL_PROTO_H
8.24. LogicalRewriteHeapCheckpoint -> CheckPointLogicalRewriteHeap
8.25. log_snap_interval_ms -> LOG_SNAPSHOT_INTERVAL_MS
8.26. from LVT -> form LVT
8.27. lwlockMode -> lwWaitMode
8.28. LWLockWait -> LWLockWaitForVar
8.29. MacroAssert -> AssertMacro
8.30. maintainer-check -> remove (orphaned after 5dd41f35)
8.31. manip.c -> remove (not present since PG95-1_01)
8.32. markleftchild -> markfollowright
8.33. mask_page_lsn -> mask_page_lsn_and_checksum
8.34. mdfd_seg_fds -> md_seg_fds
8.35. md_update -> px_md_update
8.36. meg -> 1 MB
8.37. MIGRATOR_API_VERSION -> remove (orphaned after 6f56b41a)
8.38. min_apply_delay -> recovery_min_apply_delay
8.39. min_multi -> cutoff_multi
8.40. minwg -> mingw
8.41. missingok -> missing_ok
8.42. mksafefunc/mkunsafefunc -> mkfunc (orphaned after 1f474d29)
8.43. MSG000001.bin -> MSG00001.bin
8.44. MSPACE -> MSSPACE
8.45. mtransfunc -> mtransfn
8.46. MULTI_QUERY -> PORTAL_MULTI_QUERY
8.47. MultixactId -> MultiXactId
8.48. MVDistinctItem -> MVNDistinctItem

In passing, I found a legacy script, FAQ2txt, that should be deleted as
unusable.

Best regards,
Alexander
diff --git a/doc/src/sgml/xplang.sgml b/doc/src/sgml/xplang.sgml
index d215ce82d0..60e0430751 100644
--- a/doc/src/sgml/xplang.sgml
+++ b/doc/src/sgml/xplang.sgml
@@ -137,7 +137,7 @@ CREATE FUNCTION <replaceable>validator_function_name</replaceable>(oid)
      <para>
       Finally, the PL must be declared with the command
 <synopsis>
-CREATE <optional>TRUSTED</optional> LANGUAGE <replaceable>language-name</replaceable>
+CREATE <optional>TRUSTED</optional> LANGUAGE <replaceable>language_name</replaceable>
     HANDLER <replaceable>handler_function_name</replaceable>
     <optional>INLINE <replaceable>inline_function_name</replaceable></optional>
     <optional>VALIDATOR <replaceable>validator_function_name</replaceable></optional> ;
diff --git a/src/backend/access/spgist/spgvacuum.c b/src/backend/access/spgist/spgvacuum.c
index 2b1662a267..478d4c0d61 100644
--- a/src/backend/access/spgist/spgvacuum.c
+++ b/src/backend/access/spgist/spgvacuum.c
@@ -842,7 +842,7 @@ spgvacuumscan(spgBulkDeleteState *bds)
 		}
 	}
 
-	/* Propagate local lastUsedPage cache to metablock */
+	/* Propagate local lastUsedPages cache to metablock */
 	SpGistUpdateMetaPage(index);
 
 	/*
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index e7a59b0a92..e172dad07f 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -2259,7 +2259,7 @@ WalSndLoop(WalSndSendDataCallback send_data)
 				WL_SOCKET_READABLE;
 
 			/*
-			 * Use fresh timestamp, not last_processed, to reduce the chance
+			 * Use fresh timestamp, not last_processing, to reduce the chance
 			 * of reaching wal_sender_timeout before sending a keepalive.
 			 */
 			sleeptime = WalSndComputeSleeptime(GetCurrentTimestamp());
@@ -2666,7 +2666,7 @@ XLogSendPhysical(void)
 	 * very close to together here so that we'll get a later position if it is
 	 * still moving.
 	 *
-	 * Because LagTrackerWriter ignores samples when the LSN hasn't advanced,
+	 * Because LagTrackerWrite ignores samples when the LSN hasn't advanced,
 	 * this gives us a cheap approximation for the WAL flush time for this
 	 * LSN.
 	 *
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index ae6780011b..fadab62950 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -3169,7 +3169,7 @@ DisplayXidCache(void)
  *
  * When we throw away subXIDs from KnownAssignedXids, we need to keep track of
  * that, similarly to tracking overflow of a PGPROC's subxids array.  We do
- * that by remembering the lastOverflowedXID, ie the last thrown-away subXID.
+ * that by remembering the lastOverflowedXid, ie the last thrown-away subXID.
  * As long as that is within the range of interesting XIDs, we have to assume
  * that subXIDs are missing from snapshots.  (Note that subXID overflow occurs
  * on primary when 65th subXID arrives, whereas on standby it occurs when 64th
diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c
index 8fcdf82922..ec8fbb9a7d 100644
--- a/src/backend/utils/adt/arrayfuncs.c
+++ b/src/backend/utils/adt/arrayfuncs.c
@@ -139,7 +139,7 @@ static void array_insert_slice(ArrayType *destArray, ArrayType *origArray,
 							   int *st, int *endp,
 							   int typlen, bool typbyval, char typalign);
 static int	array_cmp(FunctionCallInfo fcinfo);
-static ArrayType *create_array_envelope(int ndims, int *dimv, int *lbv, int nbytes,
+static ArrayType *create_array_envelope(int ndims, int *dimv, int *lbsv, int nbytes,
 										Oid elmtype, int dataoffset);
 static ArrayType *array_fill_internal(ArrayType *dims, ArrayType *lbs,
 									  Datum value, bool isnull, Oid elmtype,
diff --git a/src/backend/utils/adt/like_match.c b/src/backend/utils/adt/like_match.c
index 9055a93813..5b322559aa 100644
--- a/src/backend/utils/adt/like_match.c
+++ b/src/backend/utils/adt/like_match.c
@@ -27,7 +27,8 @@
 /*
  *	Originally written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986.
  *	Rich $alz is now <rs...@bbn.com>.
- *	Special thanks to Lars Mathiesen <thor...@diku.dk> for the LABORT code.
+ *	Special thanks to Lars Mathiesen <thor...@diku.dk> for the
+ *	LIKE_ABORT code.
  *
  *	This code was shamelessly stolen from the "pql" code by myself and
  *	slightly modified :)
diff --git a/src/backend/utils/adt/windowfuncs.c b/src/backend/utils/adt/windowfuncs.c
index aa177df017..506e59afa1 100644
--- a/src/backend/utils/adt/windowfuncs.c
+++ b/src/backend/utils/adt/windowfuncs.c
@@ -75,7 +75,7 @@ rank_up(WindowObject winobj)
 
 
 /*
- * row_number
+ * window_row_number
  * just increment up from 1 until current partition finishes.
  */
 Datum
@@ -90,7 +90,7 @@ window_row_number(PG_FUNCTION_ARGS)
 
 
 /*
- * rank
+ * window_rank
  * Rank changes when key columns change.
  * The new rank number is the current row number.
  */
@@ -111,7 +111,7 @@ window_rank(PG_FUNCTION_ARGS)
 }
 
 /*
- * dense_rank
+ * window_dense_rank
  * Rank increases by 1 when key columns change.
  */
 Datum
@@ -131,7 +131,7 @@ window_dense_rank(PG_FUNCTION_ARGS)
 }
 
 /*
- * percent_rank
+ * window_percent_rank
  * return fraction between 0 and 1 inclusive,
  * which is described as (RK - 1) / (NR - 1), where RK is the current row's
  * rank and NR is the total number of rows, per spec.
@@ -160,7 +160,7 @@ window_percent_rank(PG_FUNCTION_ARGS)
 }
 
 /*
- * cume_dist
+ * window_cume_dist
  * return fraction between 0 and 1 inclusive,
  * which is described as NP / NR, where NP is the number of rows preceding or
  * peers to the current row, and NR is the total number of rows, per spec.
@@ -203,7 +203,7 @@ window_cume_dist(PG_FUNCTION_ARGS)
 }
 
 /*
- * ntile
+ * window_ntile
  * compute an exact numeric value with scale 0 (zero),
  * ranging from 1 (one) to n, per spec.
  */
@@ -329,7 +329,7 @@ leadlag_common(FunctionCallInfo fcinfo,
 }
 
 /*
- * lag
+ * window_lag
  * returns the value of VE evaluated on a row that is 1
  * row before the current row within a partition,
  * per spec.
@@ -341,7 +341,7 @@ window_lag(PG_FUNCTION_ARGS)
 }
 
 /*
- * lag_with_offset
+ * window_lag_with_offset
  * returns the value of VE evaluated on a row that is OFFSET
  * rows before the current row within a partition,
  * per spec.
@@ -353,8 +353,8 @@ window_lag_with_offset(PG_FUNCTION_ARGS)
 }
 
 /*
- * lag_with_offset_and_default
- * same as lag_with_offset but accepts default value
+ * window_lag_with_offset_and_default
+ * same as window_lag_with_offset but accepts default value
  * as its third argument.
  */
 Datum
@@ -364,7 +364,7 @@ window_lag_with_offset_and_default(PG_FUNCTION_ARGS)
 }
 
 /*
- * lead
+ * window_lead
  * returns the value of VE evaluated on a row that is 1
  * row after the current row within a partition,
  * per spec.
@@ -376,7 +376,7 @@ window_lead(PG_FUNCTION_ARGS)
 }
 
 /*
- * lead_with_offset
+ * window_lead_with_offset
  * returns the value of VE evaluated on a row that is OFFSET
  * number of rows after the current row within a partition,
  * per spec.
@@ -388,8 +388,8 @@ window_lead_with_offset(PG_FUNCTION_ARGS)
 }
 
 /*
- * lead_with_offset_and_default
- * same as lead_with_offset but accepts default value
+ * window_lead_with_offset_and_default
+ * same as window_lead_with_offset but accepts default value
  * as its third argument.
  */
 Datum
@@ -399,7 +399,7 @@ window_lead_with_offset_and_default(PG_FUNCTION_ARGS)
 }
 
 /*
- * first_value
+ * window_first_value
  * return the value of VE evaluated on the first row of the
  * window frame, per spec.
  */
@@ -420,7 +420,7 @@ window_first_value(PG_FUNCTION_ARGS)
 }
 
 /*
- * last_value
+ * window_last_value
  * return the value of VE evaluated on the last row of the
  * window frame, per spec.
  */
@@ -441,7 +441,7 @@ window_last_value(PG_FUNCTION_ARGS)
 }
 
 /*
- * nth_value
+ * window_nth_value
  * return the value of VE evaluated on the n-th row from the first
  * row of the window frame, per spec.
  */
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 04d77ad700..09eabfbe5a 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -2024,7 +2024,7 @@ make_template0(FILE *cmdfd)
 		"CREATE DATABASE template0 IS_TEMPLATE = true ALLOW_CONNECTIONS = false;\n\n",
 
 		/*
-		 * We use the OID of template0 to determine lastsysoid
+		 * We use the OID of template0 to determine datlastsysoid
 		 */
 		"UPDATE pg_database SET datlastsysoid = "
 		"    (SELECT oid FROM pg_database "
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index 3a8cddf4ff..48d4ebdd96 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -2250,7 +2250,7 @@ PQsendDescribe(PGconn *conn, char desc_type, const char *desc_target)
 	/* remember we are doing a Describe */
 	conn->queryclass = PGQUERY_DESCRIBE;
 
-	/* reset last-query string (not relevant now) */
+	/* reset last_query string (not relevant now) */
 	if (conn->last_query)
 	{
 		free(conn->last_query);
diff --git a/contrib/pgcrypto/px-crypt.h b/contrib/pgcrypto/px-crypt.h
index 08001a81f5..4efcad40dd 100644
--- a/contrib/pgcrypto/px-crypt.h
+++ b/contrib/pgcrypto/px-crypt.h
@@ -39,7 +39,7 @@
 #define PX_MAX_SALT_LEN		128
 
 /* default rounds for xdes salt */
-/* NetBSD bin/passwd/local_passwd.c has (29 * 25)*/
+/* NetBSD bin/passwd/local_passwd.c had 29 * 25 (in rev. 1.19) */
 #define PX_XDES_ROUNDS		(29 * 25)
 
 /* default for blowfish salt */
diff --git a/doc/src/sgml/custom-scan.sgml b/doc/src/sgml/custom-scan.sgml
index ab9b055d9a..b8963a28eb 100644
--- a/doc/src/sgml/custom-scan.sgml
+++ b/doc/src/sgml/custom-scan.sgml
@@ -83,10 +83,7 @@ typedef struct CustomPath
     by <literal>nodeToString</literal>, so that debugging routines that attempt to
     print the custom path will work as designed.  <structfield>methods</structfield> must
     point to a (usually statically allocated) object implementing the required
-    custom path methods, of which there is currently only one.  The
-    <structfield>LibraryName</structfield> and <structfield>SymbolName</structfield> fields must also
-    be initialized so that the dynamic loader can resolve them to locate the
-    method table.
+    custom path methods, of which there is currently only one.
   </para>
 
   <para>
diff --git a/src/backend/access/gin/gindatapage.c b/src/backend/access/gin/gindatapage.c
index 21de8ed714..e8c34d6b1f 100644
--- a/src/backend/access/gin/gindatapage.c
+++ b/src/backend/access/gin/gindatapage.c
@@ -1371,7 +1371,7 @@ disassembleLeaf(Page page)
 	if (GinPageIsCompressed(page))
 	{
 		/*
-		 * Create a leafSegment entry for each segment.
+		 * Create a leafSegmentInfo entry for each segment.
 		 */
 		seg = GinDataLeafPageGetPostingList(page);
 		segbegin = (Pointer) seg;
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index d7930c077d..1bbaeeebf4 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -1988,7 +1988,7 @@ StartTransaction(void)
 
 	/*
 	 * Advertise it in the proc array.  We assume assignment of
-	 * LocalTransactionID is atomic, and the backendId should be set already.
+	 * localTransactionId is atomic, and the backendId should be set already.
 	 */
 	Assert(MyProc->backendId == vxid.backendId);
 	MyProc->lxid = vxid.localTransactionId;
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index 9358219aa6..e2cd5b9f60 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -1796,14 +1796,9 @@ interpret_ident_response(const char *ident_response,
 
 
 /*
- *	Talk to the ident server on host "remote_ip_addr" and find out who
- *	owns the tcp connection from his port "remote_port" to port
- *	"local_port_addr" on host "local_ip_addr".  Return the user name the
- *	ident server gives as "*ident_user".
- *
- *	IP addresses and port numbers are in network byte order.
- *
- *	But iff we're unable to get the information from ident, return false.
+ *	Talk to the ident server on port->raddr and find out who
+ *	owns the tcp connection to port->laddr.
+ *	It the username successfully retrieved, check the usermap.
  *
  *	XXX: Using WaitLatchOrSocket() and doing a CHECK_FOR_INTERRUPTS() if the
  *	latch was set would improve the responsiveness to timeouts/cancellations.
diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c
index 25b7e314af..01ddffec40 100644
--- a/src/backend/storage/ipc/standby.c
+++ b/src/backend/storage/ipc/standby.c
@@ -99,7 +99,7 @@ InitRecoveryTransactionEnvironment(void)
 	 * Lock a virtual transaction id for Startup process.
 	 *
 	 * We need to do GetNextLocalTransactionId() because
-	 * SharedInvalBackendInit() leaves localTransactionid invalid and the lock
+	 * SharedInvalBackendInit() leaves localTransactionId invalid and the lock
 	 * manager doesn't like that at all.
 	 *
 	 * Note that we don't need to run XactLockTableInsert() because nobody
diff --git a/src/bin/pg_controldata/pg_controldata.c b/src/bin/pg_controldata/pg_controldata.c
index 390ea0a939..ff17804723 100644
--- a/src/bin/pg_controldata/pg_controldata.c
+++ b/src/bin/pg_controldata/pg_controldata.c
@@ -4,7 +4,7 @@
  * reads the data from $PGDATA/global/pg_control
  *
  * copyright (c) Oliver Elphick <o...@lfix.co.uk>, 2001;
- * licence: BSD
+ * license: BSD
  *
  * src/bin/pg_controldata/pg_controldata.c
  */
diff --git a/src/bin/pg_upgrade/pg_upgrade.h b/src/bin/pg_upgrade/pg_upgrade.h
index ca6a9efd9c..7516b5b881 100644
--- a/src/bin/pg_upgrade/pg_upgrade.h
+++ b/src/bin/pg_upgrade/pg_upgrade.h
@@ -19,7 +19,6 @@
 #define USER_NAME_SIZE		128
 
 #define MAX_STRING			1024
-#define LINE_ALLOC			4096
 #define QUERY_ALLOC			8192
 
 #define MIGRATOR_API_VERSION	1
diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h
index 986bb6433a..6efb7a9648 100644
--- a/src/include/storage/lock.h
+++ b/src/include/storage/lock.h
@@ -594,4 +594,4 @@ extern void VirtualXactLockTableInsert(VirtualTransactionId vxid);
 extern void VirtualXactLockTableCleanup(void);
 extern bool VirtualXactLock(VirtualTransactionId vxid, bool wait);
 
-#endif							/* LOCK_H */
+#endif							/* LOCK_H_ */
diff --git a/src/include/storage/lockdefs.h b/src/include/storage/lockdefs.h
index 3c2c47dc6a..bda08edcfd 100644
--- a/src/include/storage/lockdefs.h
+++ b/src/include/storage/lockdefs.h
@@ -56,4 +56,4 @@ typedef struct xl_standby_lock
 	Oid			relOid;			/* OID of table */
 } xl_standby_lock;
 
-#endif							/* LOCKDEF_H_ */
+#endif							/* LOCKDEFS_H_ */
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 321af38b0c..dc3f207e1c 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -23,7 +23,7 @@ standard_targets = all install installdirs uninstall distprep clean distclean ma
 # these targets should recurse even into subdirectories not being built:
 standard_always_targets = distprep clean distclean maintainer-clean
 
-.PHONY: $(standard_targets) install-strip html man installcheck-parallel maintainer-check
+.PHONY: $(standard_targets) install-strip html man installcheck-parallel
 
 # make `all' the default target
 all:
diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
index 72a448ad31..4d4264fef3 100644
--- a/src/backend/access/heap/rewriteheap.c
+++ b/src/backend/access/heap/rewriteheap.c
@@ -787,7 +787,7 @@ raw_heap_insert(RewriteState state, HeapTuple tup)
  * Instead we simply write the mapping files out to disk, *before* the
  * XLogInsert() is performed. That guarantees that either the XLogInsert() is
  * inserted after the checkpoint's redo pointer or that the checkpoint (via
- * LogicalRewriteHeapCheckpoint()) has flushed the (partial) mapping file to
+ * CheckPointLogicalRewriteHeap()) has flushed the (partial) mapping file to
  * disk. That leaves the tail end that has not yet been flushed open to
  * corruption, which is solved by including the current offset in the
  * xl_heap_rewrite_mapping records and truncating the mapping file to it
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index da3d250986..b20daa66d5 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -1796,14 +1796,14 @@ WaitXLogInsertionsToFinish(XLogRecPtr upto)
 		do
 		{
 			/*
-			 * See if this insertion is in progress. LWLockWait will wait for
-			 * the lock to be released, or for the 'value' to be set by a
-			 * LWLockUpdateVar call.  When a lock is initially acquired, its
-			 * value is 0 (InvalidXLogRecPtr), which means that we don't know
-			 * where it's inserting yet.  We will have to wait for it.  If
-			 * it's a small insertion, the record will most likely fit on the
-			 * same page and the inserter will release the lock without ever
-			 * calling LWLockUpdateVar.  But if it has to sleep, it will
+			 * See if this insertion is in progress.  LWLockWaitForVar will
+			 * wait for the lock to be released, or for the 'value' to be set
+			 * by a LWLockUpdateVar call.  When a lock is initially acquired,
+			 * its value is 0 (InvalidXLogRecPtr), which means that we don't
+			 * know where it's inserting yet.  We will have to wait for it.
+			 * If it's a small insertion, the record will most likely fit on
+			 * the same page and the inserter will release the lock without
+			 * ever calling LWLockUpdateVar.  But if it has to sleep, it will
 			 * advertise the insertion point with LWLockUpdateVar before
 			 * sleeping.
 			 */
diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c
index e6b6c549de..8ec16a3fb8 100644
--- a/src/backend/postmaster/bgwriter.c
+++ b/src/backend/postmaster/bgwriter.c
@@ -291,10 +291,10 @@ BackgroundWriterMain(void)
 		 * significantly bigger than BgWriterDelay, so we don't complicate the
 		 * overall timeout handling but just assume we're going to get called
 		 * often enough even if hibernation mode is active. It's not that
-		 * important that log_snap_interval_ms is met strictly. To make sure
-		 * we're not waking the disk up unnecessarily on an idle system we
-		 * check whether there has been any WAL inserted since the last time
-		 * we've logged a running xacts.
+		 * important that LOG_SNAPSHOT_INTERVAL_MS is met strictly. To make
+		 * sure we're not waking the disk up unnecessarily on an idle system
+		 * we check whether there has been any WAL inserted since the last
+		 * time we've logged a running xacts.
 		 *
 		 * We do this logging in the bgwriter as it is the only process that
 		 * is run regularly and returns to its mainloop all the time. E.g.
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index bc1aa88322..c77d47c01c 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -232,7 +232,7 @@ LOG_LWDEBUG(const char *where, LWLock *lock, const char *msg)
 
 static void init_lwlock_stats(void);
 static void print_lwlock_stats(int code, Datum arg);
-static lwlock_stats * get_lwlock_stats_entry(LWLock *lockid);
+static lwlock_stats * get_lwlock_stats_entry(LWLock *lock);
 
 static void
 init_lwlock_stats(void)
diff --git a/src/common/unicode_norm.c b/src/common/unicode_norm.c
index 6281f2222f..89c5533212 100644
--- a/src/common/unicode_norm.c
+++ b/src/common/unicode_norm.c
@@ -178,7 +178,7 @@ recompose_code(uint32 start, uint32 code, uint32 *result)
 			 ((start - SBASE) % TCOUNT) == 0 &&
 			 code >= TBASE && code < (TBASE + TCOUNT))
 	{
-		/* make syllable of from LVT */
+		/* make syllable of form LVT */
 		uint32		tindex = code - TBASE;
 
 		*result = start + tindex;
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h
index 9c0000cc59..3fc430af01 100644
--- a/src/include/replication/logicalproto.h
+++ b/src/include/replication/logicalproto.h
@@ -19,8 +19,8 @@
 /*
  * Protocol capabilities
  *
- * LOGICAL_PROTO_VERSION_NUM is our native protocol and the greatest version
- * we can support. PGLOGICAL_PROTO_MIN_VERSION_NUM is the oldest version we
+ * LOGICALREP_PROTO_VERSION_NUM is our native protocol and the greatest version
+ * we can support. LOGICALREP_PROTO_MIN_VERSION_NUM is the oldest version we
  * have backwards compatibility for. The client requests protocol version at
  * connect time.
  */
@@ -106,4 +106,4 @@ extern LogicalRepRelation *logicalrep_read_rel(StringInfo in);
 extern void logicalrep_write_typ(StringInfo out, Oid typoid);
 extern void logicalrep_read_typ(StringInfo out, LogicalRepTyp *ltyp);
 
-#endif							/* LOGICALREP_PROTO_H */
+#endif							/* LOGICAL_PROTO_H */
diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h
index 34b68ad0e0..4ef6d8ddd4 100644
--- a/src/include/storage/bufpage.h
+++ b/src/include/storage/bufpage.h
@@ -306,7 +306,7 @@ typedef PageHeaderData *PageHeader;
  * This is intended to catch use of the pointer before page initialization.
  * It is implemented as a function due to the limitations of the MSVC
  * compiler, which choked on doing all these tests within another macro.  We
- * return true so that MacroAssert() can be used while still getting the
+ * return true so that AssertMacro() can be used while still getting the
  * specifics from the macro failure within this function.
  */
 static inline bool
diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h
index 08e0dc8144..f627dfedc5 100644
--- a/src/include/storage/lwlock.h
+++ b/src/include/storage/lwlock.h
@@ -133,7 +133,7 @@ typedef enum LWLockMode
 {
 	LW_EXCLUSIVE,
 	LW_SHARED,
-	LW_WAIT_UNTIL_FREE			/* A special mode used in PGPROC->lwlockMode,
+	LW_WAIT_UNTIL_FREE			/* A special mode used in PGPROC->lwWaitMode,
 								 * when waiting for lock to become free. Not
 								 * to be used as LWLockAcquire argument */
 } LWLockMode;
diff --git a/contrib/pgcrypto/pgp-decrypt.c b/contrib/pgcrypto/pgp-decrypt.c
index 7d8951cda4..eed0f6ad2d 100644
--- a/contrib/pgcrypto/pgp-decrypt.c
+++ b/contrib/pgcrypto/pgp-decrypt.c
@@ -355,7 +355,7 @@ mdc_finish(PGP_Context *ctx, PullFilter *src, int len)
 	if (len != 20)
 		return PXE_PGP_CORRUPT_DATA;
 
-	/* mdc_read should not call md_update */
+	/* mdc_read should not call px_md_update */
 	ctx->in_mdc_pkt = 1;
 
 	/* read data */
diff --git a/src/backend/access/common/bufmask.c b/src/backend/access/common/bufmask.c
index ee1c6f234a..bcd9bd007b 100644
--- a/src/backend/access/common/bufmask.c
+++ b/src/backend/access/common/bufmask.c
@@ -20,7 +20,7 @@
 #include "access/bufmask.h"
 
 /*
- * mask_page_lsn
+ * mask_page_lsn_and_checksum
  *
  * In consistency checks, the LSN of the two pages compared will likely be
  * different because of concurrent operations when the WAL is generated and
diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
index 4d4264fef3..a17508a82f 100644
--- a/src/backend/access/heap/rewriteheap.c
+++ b/src/backend/access/heap/rewriteheap.c
@@ -237,7 +237,7 @@ static void logical_end_heap_rewrite(RewriteState state);
  * new_heap		new, locked heap relation to insert tuples to
  * oldest_xmin	xid used by the caller to determine which tuples are dead
  * freeze_xid	xid before which tuples will be frozen
- * min_multi	multixact before which multis will be removed
+ * cutoff_multi	multixact before which multis will be removed
  * use_wal		should the inserts to the new heap be WAL-logged?
  *
  * Returns an opaque RewriteState, allocated in current memory context,
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index b20daa66d5..27341ae026 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6024,7 +6024,10 @@ recoveryApplyDelay(XLogReaderState *record)
 		TimestampDifference(GetCurrentTimestamp(), recoveryDelayUntilTime,
 							&secs, &microsecs);
 
-		/* NB: We're ignoring waits below min_apply_delay's resolution. */
+		/*
+		 * NB: We're ignoring waits below recovery_min_apply_delay's
+		 * resolution.
+		 */
 		if (secs <= 0 && microsecs / 1000 <= 0)
 			break;
 
diff --git a/src/backend/commands/operatorcmds.c b/src/backend/commands/operatorcmds.c
index 17f54410a0..d733aa4826 100644
--- a/src/backend/commands/operatorcmds.c
+++ b/src/backend/commands/operatorcmds.c
@@ -27,9 +27,6 @@
  *		"create operator":
  *				operators
  *
- *		Most of the parse-tree manipulation routines are defined in
- *		commands/manip.c.
- *
  *-------------------------------------------------------------------------
  */
 #include "postgres.h"
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index 52136ad558..07f3c93d3f 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -731,7 +731,7 @@ mdwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
  *	mdnblocks() -- Get the number of blocks stored in a relation.
  *
  *		Important side effect: all active segments of the relation are opened
- *		and added to the mdfd_seg_fds array.  If this routine has not been
+ *		and added to the md_seg_fds array.  If this routine has not been
  *		called, then only segments up to the last one actually touched
  *		are present in the array.
  */
diff --git a/src/backend/utils/mmgr/aset.c b/src/backend/utils/mmgr/aset.c
index 6e4a343439..6b63d6f85d 100644
--- a/src/backend/utils/mmgr/aset.c
+++ b/src/backend/utils/mmgr/aset.c
@@ -915,7 +915,7 @@ AllocSetAlloc(MemoryContext context, Size size)
 
 		/*
 		 * We could be asking for pretty big blocks here, so cope if malloc
-		 * fails.  But give up if there's less than a meg or so available...
+		 * fails.  But give up if there's less than 1 MB or so available...
 		 */
 		while (block == NULL && blksize > 1024 * 1024)
 		{
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index 3a9a65d31d..068b65a2af 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -1725,7 +1725,7 @@ pgwin32_doRunAsService(void)
 /*
  * Mingw headers are incomplete, and so are the libraries. So we have to load
  * a whole lot of API functions dynamically. Since we have to do this anyway,
- * also load the couple of functions that *do* exist in minwg headers but not
+ * also load the couple of functions that *do* exist in mingw headers but not
  * on NT4. That way, we don't break on NT4.
  */
 typedef BOOL (WINAPI * __CreateRestrictedToken) (HANDLE, DWORD, DWORD, PSID_AND_ATTRIBUTES, DWORD, PLUID_AND_ATTRIBUTES, DWORD, PSID_AND_ATTRIBUTES, PHANDLE);
diff --git a/src/bin/pg_upgrade/pg_upgrade.h b/src/bin/pg_upgrade/pg_upgrade.h
index 7516b5b881..57c4ed6913 100644
--- a/src/bin/pg_upgrade/pg_upgrade.h
+++ b/src/bin/pg_upgrade/pg_upgrade.h
@@ -21,8 +21,6 @@
 #define MAX_STRING			1024
 #define QUERY_ALLOC			8192
 
-#define MIGRATOR_API_VERSION	1
-
 #define MESSAGE_WIDTH		60
 
 #define GET_MAJOR_VERSION(v)	((v) / 100)
diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h
index 0488d01c9b..acebe6c93b 100644
--- a/src/include/access/gist_private.h
+++ b/src/include/access/gist_private.h
@@ -417,7 +417,7 @@ extern bool gistplacetopage(Relation rel, Size freespace, GISTSTATE *giststate,
 							OffsetNumber oldoffnum, BlockNumber *newblkno,
 							Buffer leftchildbuf,
 							List **splitinfo,
-							bool markleftchild,
+							bool markfollowright,
 							Relation heapRel,
 							bool is_build);
 
diff --git a/doc/src/sgml/ref/create_aggregate.sgml b/doc/src/sgml/ref/create_aggregate.sgml
index ca0e9db8b1..644657dd5e 100644
--- a/doc/src/sgml/ref/create_aggregate.sgml
+++ b/doc/src/sgml/ref/create_aggregate.sgml
@@ -211,7 +211,7 @@ CREATE [ OR REPLACE ] AGGREGATE <replaceable class="parameter">name</replaceable
    as described in <xref linkend="xaggr-moving-aggregates"/>.  This requires
    specifying the <literal>MSFUNC</literal>, <literal>MINVFUNC</literal>,
    and <literal>MSTYPE</literal> parameters, and optionally
-   the <literal>MSPACE</literal>, <literal>MFINALFUNC</literal>,
+   the <literal>MSSPACE</literal>, <literal>MFINALFUNC</literal>,
    <literal>MFINALFUNC_EXTRA</literal>, <literal>MFINALFUNC_MODIFY</literal>,
    and <literal>MINITCOND</literal> parameters.  Except for <literal>MINVFUNC</literal>,
    these parameters work like the corresponding simple-aggregate parameters
diff --git a/src/backend/catalog/pg_aggregate.c b/src/backend/catalog/pg_aggregate.c
index 7cab039ded..201242e796 100644
--- a/src/backend/catalog/pg_aggregate.c
+++ b/src/backend/catalog/pg_aggregate.c
@@ -733,7 +733,7 @@ AggregateCreate(const char *aggName,
 	 * Create dependencies for the aggregate (above and beyond those already
 	 * made by ProcedureCreate).  Note: we don't need an explicit dependency
 	 * on aggTransType since we depend on it indirectly through transfn.
-	 * Likewise for aggmTransType using the mtransfunc, if it exists.
+	 * Likewise for aggmTransType using the mtransfn, if it exists.
 	 *
 	 * If we're replacing an existing definition, ProcedureCreate deleted all
 	 * our existing dependencies, so we have to do the same things here either
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index fc1e1564a6..95881a8550 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -1854,7 +1854,7 @@ get_db_info(const char *name, LOCKMODE lockmode,
 				/* limit of frozen XIDs */
 				if (dbFrozenXidP)
 					*dbFrozenXidP = dbform->datfrozenxid;
-				/* minimum MultixactId */
+				/* minimum MultiXactId */
 				if (dbMinMultiP)
 					*dbMinMultiP = dbform->datminmxid;
 				/* default tablespace for this database */
diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c
index 1ed2838ad4..d3b8afa35c 100644
--- a/src/backend/tcop/pquery.c
+++ b/src/backend/tcop/pquery.c
@@ -1023,9 +1023,10 @@ FillPortalStore(Portal portal, bool isTopLevel)
 
 			/*
 			 * Run the portal to completion just as for the default
-			 * MULTI_QUERY case, but send the primary query's output to the
-			 * tuplestore.  Auxiliary query outputs are discarded.  Set the
-			 * portal's holdSnapshot to the snapshot used (or a copy of it).
+			 * PORTAL_MULTI_QUERY case, but send the primary query's output
+			 * to the tuplestore.  Auxiliary query outputs are discarded.
+			 * Set the portal's holdSnapshot to the snapshot used
+			 * (or a copy of it).
 			 */
 			PortalRunMulti(portal, isTopLevel, true,
 						   treceiver, None_Receiver, completionTag);
diff --git a/src/bin/pgevent/README b/src/bin/pgevent/README
index 3d0329ec33..10ec8d2d62 100644
--- a/src/bin/pgevent/README
+++ b/src/bin/pgevent/README
@@ -3,7 +3,7 @@ src/bin/pgevent/README
 pgevent
 =======
 
-MSG000001.bin is a binary file, result of Microsoft MC compiler. MC compiler
+MSG00001.bin is a binary file, result of Microsoft MC compiler. MC compiler
 can be downloaded for free with MS Core SDK but it is not included with MSYS
 tools and I didn't find an alternative way to compile MC file.
 
diff --git a/src/include/commands/dbcommands.h b/src/include/commands/dbcommands.h
index 28bf21153d..154c8157ee 100644
--- a/src/include/commands/dbcommands.h
+++ b/src/include/commands/dbcommands.h
@@ -26,7 +26,7 @@ extern Oid	AlterDatabase(ParseState *pstate, AlterDatabaseStmt *stmt, bool isTop
 extern Oid	AlterDatabaseSet(AlterDatabaseSetStmt *stmt);
 extern ObjectAddress AlterDatabaseOwner(const char *dbname, Oid newOwnerId);
 
-extern Oid	get_database_oid(const char *dbname, bool missingok);
+extern Oid	get_database_oid(const char *dbname, bool missing_ok);
 extern char *get_database_name(Oid dbid);
 
 extern void check_encoding_locale_matches(int encoding, const char *collate, const char *ctype);
diff --git a/src/include/statistics/statistics.h b/src/include/statistics/statistics.h
index cb7bc630e9..3b7da3be60 100644
--- a/src/include/statistics/statistics.h
+++ b/src/include/statistics/statistics.h
@@ -22,7 +22,7 @@
 #define STATS_NDISTINCT_MAGIC		0xA352BFA4	/* struct identifier */
 #define STATS_NDISTINCT_TYPE_BASIC	1	/* struct version */
 
-/* MVDistinctItem represents a single combination of columns */
+/* MVNDistinctItem represents a single combination of columns */
 typedef struct MVNDistinctItem
 {
 	double		ndistinct;		/* ndistinct value for this combination */
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index 2db13d3030..c480999c51 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -2091,7 +2091,7 @@ plperlu_validator(PG_FUNCTION_ARGS)
 
 
 /*
- * Uses mksafefunc/mkunsafefunc to create a subroutine whose text is
+ * Uses mkfunc to create a subroutine whose text is
  * supplied in s, and returns a reference to it
  */
 static void
diff --git a/src/tools/FAQ2txt b/src/tools/FAQ2txt
deleted file mode 100755
index ab61d4d5f8..0000000000
--- a/src/tools/FAQ2txt
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-# src/tools/FAQ2txt:
-
-# Converts doc/src/FAQ/FAQ.html to text file doc/FAQ
-
-lynx -force_html -dont_wrap_pre -dump -hiddenlinks=ignore -nolist "$@"

Reply via email to