From 118a3ad6ce6a33b6e393a889322616ded8ac646a Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 6 Apr 2022 07:38:49 -0500
Subject: [PATCH 12/19] v15 comment typos

---
 contrib/ltree/ltree.h                     | 2 +-
 doc/src/sgml/glossary.sgml                | 2 +-
 doc/src/sgml/monitoring.sgml              | 2 +-
 src/backend/access/heap/heapam.c          | 2 +-
 src/backend/access/transam/xlogrecovery.c | 2 +-
 src/backend/commands/dbcommands.c         | 2 +-
 src/backend/commands/vacuumparallel.c     | 2 +-
 src/backend/optimizer/path/costsize.c     | 2 +-
 src/backend/optimizer/path/pathkeys.c     | 4 ++--
 src/backend/parser/parse_expr.c           | 2 +-
 src/backend/utils/adt/genfile.c           | 2 +-
 src/backend/utils/cache/relmapper.c       | 4 ++--
 src/backend/utils/error/csvlog.c          | 2 +-
 src/backend/utils/error/jsonlog.c         | 2 +-
 src/backend/utils/mmgr/generation.c       | 2 +-
 src/bin/pg_basebackup/pg_basebackup.c     | 2 +-
 src/bin/pgbench/pgbench.c                 | 4 ++--
 src/bin/psql/copy.c                       | 2 +-
 src/bin/psql/describe.c                   | 2 +-
 src/bin/psql/tab-complete.c               | 2 +-
 src/tools/mark_pgdllimport.pl             | 2 +-
 21 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/contrib/ltree/ltree.h b/contrib/ltree/ltree.h
index 10341d60212..564e4fa81b8 100644
--- a/contrib/ltree/ltree.h
+++ b/contrib/ltree/ltree.h
@@ -24,7 +24,7 @@
  * modified to look for -D compile flags in Makefiles, so here, in order to
  * get the historic behavior of LOWER_NODE not being defined on MSVC, we only
  * define it when not building in that environment.  This is important as we
- * want to maintain the same LOWER_NODE behavior after a pg_update.
+ * want to maintain the same LOWER_NODE behavior after a pg_upgrade.
  */
 #ifndef _MSC_VER
 #define LOWER_NODE
diff --git a/doc/src/sgml/glossary.sgml b/doc/src/sgml/glossary.sgml
index b187506d5e5..f81fdc31f9e 100644
--- a/doc/src/sgml/glossary.sgml
+++ b/doc/src/sgml/glossary.sgml
@@ -137,7 +137,7 @@
      <!-- NB: In the code, the autovac launcher doesn't use the auxiliary
           process scaffolding; however it does behave as one so we list it
           here anyway. In addition, logger isn't connected to shared memory so
-          most code outside postmaster.c doesn't even consider them "procs" in
+          most code outside postmaster.c doesn't even consider it a "proc" in
           the first place.
           -->
      the <glossterm linkend="glossary-autovacuum">autovacuum launcher</glossterm>
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 2f44113caa5..87b6e5fb5e8 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -200,7 +200,7 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
 
   <para>
    Cumulative statistics are collected in shared memory. Every
-   <productname>PostgreSQL</productname> process collects statistics locally
+   <productname>PostgreSQL</productname> process collects statistics locally,
    then updates the shared data at appropriate intervals.  When a server,
    including a physical replica, shuts down cleanly, a permanent copy of the
    statistics data is stored in the <filename>pg_stat</filename> subdirectory,
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 1ee985f6330..983db140aaf 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -1470,7 +1470,7 @@ heap_getnextslot_tidrange(TableScanDesc sscan, ScanDirection direction,
 		 * heap_set_tidrange will have used heap_setscanlimits to limit the
 		 * range of pages we scan to only ones that can contain the TID range
 		 * we're scanning for.  Here we must filter out any tuples from these
-		 * pages that are outwith that range.
+		 * pages that are outside that range.
 		 */
 		if (ItemPointerCompare(&scan->rs_ctup.t_self, mintid) < 0)
 		{
diff --git a/src/backend/access/transam/xlogrecovery.c b/src/backend/access/transam/xlogrecovery.c
index 2e555f8573d..4ee29182ac8 100644
--- a/src/backend/access/transam/xlogrecovery.c
+++ b/src/backend/access/transam/xlogrecovery.c
@@ -2975,7 +2975,7 @@ ReadRecord(XLogPrefetcher *xlogprefetcher, int emode,
 			/*
 			 * When not in standby mode we find that WAL ends in an incomplete
 			 * record, keep track of that record.  After recovery is done,
-			 * we'll write a record to indicate downstream WAL readers that
+			 * we'll write a record to indicate to downstream WAL readers that
 			 * that portion is to be ignored.
 			 */
 			if (!StandbyMode &&
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index ce776c53cad..1bbecfeddf6 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -386,7 +386,7 @@ ScanSourceDatabasePgClassPage(Page page, Buffer buf, Oid tbid, Oid dbid,
  * needs to be copied from the source database to the destination database,
  * and if so, construct a CreateDBRelInfo for it.
  *
- * Visbility checks are handled by the caller, so our job here is just
+ * Visibility checks are handled by the caller, so our job here is just
  * to assess the data stored in the tuple.
  */
 CreateDBRelInfo *
diff --git a/src/backend/commands/vacuumparallel.c b/src/backend/commands/vacuumparallel.c
index 6b4f742578e..bbf3b69c57e 100644
--- a/src/backend/commands/vacuumparallel.c
+++ b/src/backend/commands/vacuumparallel.c
@@ -12,7 +12,7 @@
  * the memory space for storing dead items allocated in the DSM segment.  We
  * launch parallel worker processes at the start of parallel index
  * bulk-deletion and index cleanup and once all indexes are processed, the
- * parallel worker processes exit.  Each time we process indexes parallelly,
+ * parallel worker processes exit.  Each time we process indexes in parallel,
  * the parallel context is re-initialized so that the same DSM can be used for
  * multiple passes of index bulk-deletion and index cleanup.
  *
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index ec3c23013a3..8166224dcc8 100644
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -1976,7 +1976,7 @@ compute_cpu_sort_cost(PlannerInfo *root, List *pathkeys, int nPresortedKeys,
 		 * by calling estimate_num_groups_incremental(), which estimates the
 		 * group size for "new" pathkeys.
 		 *
-		 * Note: estimate_num_groups_incremntal does not handle fake Vars, so use
+		 * Note: estimate_num_groups_incremental does not handle fake Vars, so use
 		 * a default estimate otherwise.
 		 */
 		if (!has_fake_var)
diff --git a/src/backend/optimizer/path/pathkeys.c b/src/backend/optimizer/path/pathkeys.c
index 75fe03fd04b..b1e0c3e41cf 100644
--- a/src/backend/optimizer/path/pathkeys.c
+++ b/src/backend/optimizer/path/pathkeys.c
@@ -2383,7 +2383,7 @@ pathkeys_useful_for_ordering(PlannerInfo *root, List *pathkeys)
  *		Count the number of pathkeys that are useful for grouping (instead of
  *		explicit sort)
  *
- * Group pathkeys could be reordered to benefit from the odering. The ordering
+ * Group pathkeys could be reordered to benefit from the ordering. The ordering
  * may not be "complete" and may require incremental sort, but that's fine. So
  * we simply count prefix pathkeys with a matching group key, and stop once we
  * find the first pathkey without a match.
@@ -2392,7 +2392,7 @@ pathkeys_useful_for_ordering(PlannerInfo *root, List *pathkeys)
  * pathkeys are useful for grouping, and we might do incremental sort to get
  * path ordered by (a,b,e).
  *
- * This logic is necessary to retain paths with ordeding not matching grouping
+ * This logic is necessary to retain paths with ordering not matching grouping
  * keys directly, without the reordering.
  *
  * Returns the length of pathkey prefix with matching group keys.
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index b6a2482f23a..3cbd5161528 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -3507,7 +3507,7 @@ transformJsonOutput(ParseState *pstate, const JsonOutput *output,
 }
 
 /*
- * Transform JSON output clause of JSON contructor functions.
+ * Transform JSON output clause of JSON constructor functions.
  *
  * Derive RETURNING type, if not specified, from argument types.
  */
diff --git a/src/backend/utils/adt/genfile.c b/src/backend/utils/adt/genfile.c
index 88f279d1b31..648d0f590b9 100644
--- a/src/backend/utils/adt/genfile.c
+++ b/src/backend/utils/adt/genfile.c
@@ -59,7 +59,7 @@ convert_and_check_filename(text *arg)
 	canonicalize_path(filename);	/* filename can change length here */
 
 	/*
-	 * Roles with privleges of the 'pg_read_server_files' role are allowed to access
+	 * Roles with privileges of the 'pg_read_server_files' role are allowed to access
 	 * any files on the server as the PG user, so no need to do any further checks
 	 * here.
 	 */
diff --git a/src/backend/utils/cache/relmapper.c b/src/backend/utils/cache/relmapper.c
index dee3387d026..75a3aedc5af 100644
--- a/src/backend/utils/cache/relmapper.c
+++ b/src/backend/utils/cache/relmapper.c
@@ -1044,7 +1044,7 @@ perform_relmap_update(bool shared, const RelMapFile *updates)
 					  (shared ? "global" : DatabasePath));
 
 	/*
-	 * We succesfully wrote the updated file, so it's now safe to rely on the
+	 * We successfully wrote the updated file, so it's now safe to rely on the
 	 * new values in this process, too.
 	 */
 	if (shared)
@@ -1093,7 +1093,7 @@ relmap_redo(XLogReaderState *record)
 		 * an existing database as we do for creating a new database. In
 		 * the latter case, taking the relmap log and sending sinval messages
 		 * is unnecessary, but harmless. If we wanted to avoid it, we could
-		 * add a flag to the WAL record to indicate which opration is being
+		 * add a flag to the WAL record to indicate which operation is being
 		 * performed.
 		 */
 		LWLockAcquire(RelationMappingLock, LW_EXCLUSIVE);
diff --git a/src/backend/utils/error/csvlog.c b/src/backend/utils/error/csvlog.c
index 89f78b447d9..5c49bc4209e 100644
--- a/src/backend/utils/error/csvlog.c
+++ b/src/backend/utils/error/csvlog.c
@@ -4,7 +4,7 @@
  *	  CSV logging
  *
  * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of Californi
+ * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
  * IDENTIFICATION
diff --git a/src/backend/utils/error/jsonlog.c b/src/backend/utils/error/jsonlog.c
index 843641c865f..f336c063e58 100644
--- a/src/backend/utils/error/jsonlog.c
+++ b/src/backend/utils/error/jsonlog.c
@@ -4,7 +4,7 @@
  *	  JSON logging
  *
  * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of Californi
+ * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
  * IDENTIFICATION
diff --git a/src/backend/utils/mmgr/generation.c b/src/backend/utils/mmgr/generation.c
index 685688c1554..56ed496386e 100644
--- a/src/backend/utils/mmgr/generation.c
+++ b/src/backend/utils/mmgr/generation.c
@@ -27,7 +27,7 @@
  *	context's 'freeblock' field.  If the freeblock field is already occupied
  *	by another free block we simply return the newly empty block to malloc.
  *
- *	This approach to free blocks requires fewer malloc/free calls for truely
+ *	This approach to free blocks requires fewer malloc/free calls for truly
  *	first allocated, first free'd allocation patterns.
  *
  *-------------------------------------------------------------------------
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 65dcfff0a03..e9e5d44abbc 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -1464,7 +1464,7 @@ ReceiveArchiveStreamChunk(size_t r, char *copybuf, void *callback_data)
 				GetCopyDataEnd(r, copybuf, cursor);
 
 				/*
-				 * The server shouldn't send progres report messages too
+				 * The server shouldn't send progress report messages too
 				 * often, so we force an update each time we receive one.
 				 */
 				progress_report(state->tablespacenum, true, false);
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index 8a31ffa0677..2430a490a95 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -3450,7 +3450,7 @@ discardUntilSync(CState *st)
 		PQclear(res);
 	}
 
-	/* exit pipline */
+	/* exit pipeline */
 	if (PQexitPipelineMode(st->con) != 1)
 	{
 		pg_log_error("client %d aborted: failed to exit pipeline mode for rolling back the failed transaction",
@@ -7261,7 +7261,7 @@ main(int argc, char **argv)
 
 	/*
 	 * All connections should be already closed in threadRun(), so this
-	 * disconnect_all() will be a no-op, but clean up the connecions just to
+	 * disconnect_all() will be a no-op, but clean up the connections just to
 	 * be sure. We don't need to measure the disconnection delays here.
 	 */
 	disconnect_all(state, nclients);
diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c
index a5ceaec3ac7..a73e22f723e 100644
--- a/src/bin/psql/copy.c
+++ b/src/bin/psql/copy.c
@@ -653,7 +653,7 @@ handleCopyIn(PGconn *conn, FILE *copystream, bool isbinary, PGresult **res)
 			 *
 			 * Make sure there's always space for four more bytes in the
 			 * buffer, plus a NUL terminator.  That way, an EOF marker is
-			 * never split across two fgets() calls, which simplies the logic.
+			 * never split across two fgets() calls, which simplifies the logic.
 			 */
 			if (buflen >= COPYBUFSIZ - 5 || (copydone && buflen > 0))
 			{
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index e8919ab0be2..d04ba2b0290 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -3080,7 +3080,7 @@ describeOneTableDetails(const char *schemaname,
 		 * servers between v11 and v14, though these must still be shown to
 		 * the user.  So we use another property that is true for such
 		 * inherited triggers to avoid them being hidden, which is their
-		 * dependendence on another trigger.
+		 * dependence on another trigger.
 		 */
 		if (pset.sversion >= 110000 && pset.sversion < 150000)
 			appendPQExpBufferStr(&buf, "(NOT t.tgisinternal OR (t.tgisinternal AND t.tgenabled = 'D') \n"
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 8f163fb7bac..10e8dbc9b1f 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -2257,7 +2257,7 @@ psql_completion(const char *text, int start, int end)
 		COMPLETE_WITH("COLUMN", "CONSTRAINT", "CHECK", "UNIQUE", "PRIMARY KEY",
 					  "EXCLUDE", "FOREIGN KEY");
 	}
-	/* ATER TABLE xxx ADD [COLUMN] yyy */
+	/* ALTER TABLE xxx ADD [COLUMN] yyy */
 	else if (Matches("ALTER", "TABLE", MatchAny, "ADD", "COLUMN", MatchAny) ||
 			 (Matches("ALTER", "TABLE", MatchAny, "ADD", MatchAny) &&
 			  !Matches("ALTER", "TABLE", MatchAny, "ADD", "COLUMN|CONSTRAINT|CHECK|UNIQUE|PRIMARY|EXCLUDE|FOREIGN")))
diff --git a/src/tools/mark_pgdllimport.pl b/src/tools/mark_pgdllimport.pl
index a09ec5a369e..83b90db6ef9 100755
--- a/src/tools/mark_pgdllimport.pl
+++ b/src/tools/mark_pgdllimport.pl
@@ -6,7 +6,7 @@
 #	Perl script that tries to add PGDLLIMPORT markings to PostgreSQL
 #	header files.
 #
-# This relies on a few idiosyncracies of the PostgreSQL cding style,
+# This relies on a few idiosyncracies of the PostgreSQL coding style,
 # such as the fact that we always use "extern" in function
 # declarations, and that we don't use // comments. It's not very
 # smart and may not catch all cases.
-- 
2.17.1

