On 11/04/2024 16:05, Daniel Gustafsson wrote:
Now that the tree has settled down a bit post-freeze I ran some tooling to
check spelling.  I was primarily interested in docs and README* which were
mostly free from simply typos, while the code had some in various comments and
one in code.  The attached fixes all that I came across (not cross-referenced
against ongoing reverts or any other fixup threads but will be before pushing
of course).

Here's a few more. I've accumulate these over the past couple of months, keeping them stashed in a branch, adding to it whenever I've spotted a minor typo while reading the code.

--
Heikki Linnakangas
Neon (https://neon.tech)
From 5f531b719c176b2f316b6341fa062af508ed2e10 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas <heikki.linnakan...@iki.fi>
Date: Sun, 7 Apr 2024 22:34:23 +0300
Subject: [PATCH 1/2] fix typos

---
 doc/src/sgml/maintenance.sgml                       | 2 +-
 doc/src/sgml/meson.build                            | 2 +-
 src/backend/access/rmgrdesc/xactdesc.c              | 2 +-
 src/backend/catalog/system_functions.sql            | 2 +-
 src/backend/commands/amcmds.c                       | 2 +-
 src/backend/commands/tablecmds.c                    | 4 ++--
 src/backend/postmaster/walsummarizer.c              | 2 +-
 src/backend/replication/logical/slotsync.c          | 2 +-
 src/backend/statistics/dependencies.c               | 4 ++--
 src/backend/utils/adt/multirangetypes.c             | 2 +-
 src/backend/utils/mmgr/aset.c                       | 4 ++--
 src/backend/utils/mmgr/generation.c                 | 4 ++--
 src/bin/pg_basebackup/bbstreamer_tar.c              | 2 +-
 src/bin/pg_combinebackup/pg_combinebackup.c         | 2 +-
 src/interfaces/libpq/fe-secure-openssl.c            | 2 +-
 src/test/modules/test_resowner/test_resowner_many.c | 2 +-
 src/test/regress/expected/aggregates.out            | 2 +-
 src/test/regress/sql/aggregates.sql                 | 2 +-
 18 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml
index 2bfa05b8bc..0be90bdc7e 100644
--- a/doc/src/sgml/maintenance.sgml
+++ b/doc/src/sgml/maintenance.sgml
@@ -802,7 +802,7 @@ HINT:  Execute a database-wide VACUUM in that database.
     <para>
      Similar to the XID case, if autovacuum fails to clear old MXIDs from a table, the
      system will begin to emit warning messages when the database's oldest MXIDs reach forty
-     million transactions from the wraparound point.  And, just as an the XID case, if these
+     million transactions from the wraparound point.  And, just as in the XID case, if these
      warnings are ignored, the system will refuse to generate new MXIDs once there are fewer
      than three million left until wraparound.
     </para>
diff --git a/doc/src/sgml/meson.build b/doc/src/sgml/meson.build
index 3a4b47d387..e418de83a7 100644
--- a/doc/src/sgml/meson.build
+++ b/doc/src/sgml/meson.build
@@ -207,7 +207,7 @@ if docs_dep.found()
   alias_target('man', man)
   alias_target('install-man', install_doc_man)
 
-  # built and installed as part of the the docs target
+  # built and installed as part of the docs target
   installdocs += install_doc_man
   docs += man
 endif
diff --git a/src/backend/access/rmgrdesc/xactdesc.c b/src/backend/access/rmgrdesc/xactdesc.c
index 41b842d80e..dccca201e0 100644
--- a/src/backend/access/rmgrdesc/xactdesc.c
+++ b/src/backend/access/rmgrdesc/xactdesc.c
@@ -25,7 +25,7 @@
  * Parse the WAL format of an xact commit and abort records into an easier to
  * understand format.
  *
- * This routines are in xactdesc.c because they're accessed in backend (when
+ * These routines are in xactdesc.c because they're accessed in backend (when
  * replaying WAL) and frontend (pg_waldump) code. This file is the only xact
  * specific one shared between both. They're complicated enough that
  * duplication would be bothersome.
diff --git a/src/backend/catalog/system_functions.sql b/src/backend/catalog/system_functions.sql
index fe2bb50f46..ae099e328c 100644
--- a/src/backend/catalog/system_functions.sql
+++ b/src/backend/catalog/system_functions.sql
@@ -5,7 +5,7 @@
  *
  * src/backend/catalog/system_functions.sql
  *
- * This file redefines certain built-in functions that it's impractical
+ * This file redefines certain built-in functions that are impractical
  * to fully define in pg_proc.dat.  In most cases that's because they use
  * SQL-standard function bodies and/or default expressions.  The node
  * tree representations of those are too unreadable, platform-dependent,
diff --git a/src/backend/commands/amcmds.c b/src/backend/commands/amcmds.c
index 10e386288a..aaa0f9a1dc 100644
--- a/src/backend/commands/amcmds.c
+++ b/src/backend/commands/amcmds.c
@@ -167,7 +167,7 @@ get_index_am_oid(const char *amname, bool missing_ok)
 
 /*
  * get_table_am_oid - given an access method name, look up its OID
- *		and verify it corresponds to an table AM.
+ *		and verify it corresponds to a table AM.
  */
 Oid
 get_table_am_oid(const char *amname, bool missing_ok)
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index e344f2e363..36080a2383 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -5687,7 +5687,7 @@ ATParseTransformCmd(List **wqueue, AlteredTableInfo *tab, Relation rel,
 			case AT_AddIndex:
 
 				/*
-				 * A primary key on a inheritance parent needs supporting NOT
+				 * A primary key on an inheritance parent needs supporting NOT
 				 * NULL constraint on its children; enqueue commands to create
 				 * those or mark them inherited if they already exist.
 				 */
@@ -20216,7 +20216,7 @@ ATExecDetachPartitionFinalize(Relation rel, RangeVar *name)
  * DetachAddConstraintIfNeeded
  *		Subroutine for ATExecDetachPartition.  Create a constraint that
  *		takes the place of the partition constraint, but avoid creating
- *		a dupe if an constraint already exists which implies the needed
+ *		a dupe if a constraint already exists which implies the needed
  *		constraint.
  */
 static void
diff --git a/src/backend/postmaster/walsummarizer.c b/src/backend/postmaster/walsummarizer.c
index 0cd5080fa7..72f6c04478 100644
--- a/src/backend/postmaster/walsummarizer.c
+++ b/src/backend/postmaster/walsummarizer.c
@@ -108,7 +108,7 @@ static WalSummarizerData *WalSummarizerCtl;
 
 /*
  * When we reach end of WAL and need to read more, we sleep for a number of
- * milliseconds that is a integer multiple of MS_PER_SLEEP_QUANTUM. This is
+ * milliseconds that is an integer multiple of MS_PER_SLEEP_QUANTUM. This is
  * the multiplier. It should vary between 1 and MAX_SLEEP_QUANTA, depending
  * on system activity. See summarizer_wait_for_wal() for how we adjust this.
  */
diff --git a/src/backend/replication/logical/slotsync.c b/src/backend/replication/logical/slotsync.c
index bda0de52db..cb39adcd0e 100644
--- a/src/backend/replication/logical/slotsync.c
+++ b/src/backend/replication/logical/slotsync.c
@@ -88,7 +88,7 @@
  * overwrites.
  *
  * The 'last_start_time' is needed by postmaster to start the slot sync worker
- * once per SLOTSYNC_RESTART_INTERVAL_SEC. In cases where a immediate restart
+ * once per SLOTSYNC_RESTART_INTERVAL_SEC. In cases where an immediate restart
  * is expected (e.g., slot sync GUCs change), slot sync worker will reset
  * last_start_time before exiting, so that postmaster can start the worker
  * without waiting for SLOTSYNC_RESTART_INTERVAL_SEC.
diff --git a/src/backend/statistics/dependencies.c b/src/backend/statistics/dependencies.c
index 5eda06839e..8d01a93b30 100644
--- a/src/backend/statistics/dependencies.c
+++ b/src/backend/statistics/dependencies.c
@@ -794,7 +794,7 @@ dependency_is_compatible_clause(Node *clause, Index relid, AttrNumber *attnum)
 	}
 	else if (IsA(clause, ScalarArrayOpExpr))
 	{
-		/* If it's an scalar array operator, check for Var IN Const. */
+		/* If it's a scalar array operator, check for Var IN Const. */
 		ScalarArrayOpExpr *expr = (ScalarArrayOpExpr *) clause;
 
 		/*
@@ -1222,7 +1222,7 @@ dependency_is_compatible_expression(Node *clause, Index relid, List *statlist, N
 	}
 	else if (IsA(clause, ScalarArrayOpExpr))
 	{
-		/* If it's an scalar array operator, check for Var IN Const. */
+		/* If it's a scalar array operator, check for Var IN Const. */
 		ScalarArrayOpExpr *expr = (ScalarArrayOpExpr *) clause;
 
 		/*
diff --git a/src/backend/utils/adt/multirangetypes.c b/src/backend/utils/adt/multirangetypes.c
index 8f12c953ca..558c6c18c3 100644
--- a/src/backend/utils/adt/multirangetypes.c
+++ b/src/backend/utils/adt/multirangetypes.c
@@ -330,7 +330,7 @@ multirange_out(PG_FUNCTION_ARGS)
 }
 
 /*
- * Binary representation: First a int32-sized count of ranges, followed by
+ * Binary representation: First an int32-sized count of ranges, followed by
  * ranges in their native binary representation.
  */
 Datum
diff --git a/src/backend/utils/mmgr/aset.c b/src/backend/utils/mmgr/aset.c
index 751cc3408c..dede30dd86 100644
--- a/src/backend/utils/mmgr/aset.c
+++ b/src/backend/utils/mmgr/aset.c
@@ -979,8 +979,8 @@ AllocSetAlloc(MemoryContext context, Size size, int flags)
 	Assert(set->blocks != NULL);
 
 	/*
-	 * If requested size exceeds maximum for chunks we hand the the request
-	 * off to AllocSetAllocLarge().
+	 * If requested size exceeds maximum for chunks we hand the request off to
+	 * AllocSetAllocLarge().
 	 */
 	if (size > set->allocChunkLimit)
 		return AllocSetAllocLarge(context, size, flags);
diff --git a/src/backend/utils/mmgr/generation.c b/src/backend/utils/mmgr/generation.c
index 5d81af1f94..b858b8d0f7 100644
--- a/src/backend/utils/mmgr/generation.c
+++ b/src/backend/utils/mmgr/generation.c
@@ -541,8 +541,8 @@ GenerationAlloc(MemoryContext context, Size size, int flags)
 #endif
 
 	/*
-	 * If requested size exceeds maximum for chunks we hand the the request
-	 * off to GenerationAllocLarge().
+	 * If requested size exceeds maximum for chunks we hand the request off to
+	 * GenerationAllocLarge().
 	 */
 	if (chunk_size > set->allocChunkLimit)
 		return GenerationAllocLarge(context, size, flags);
diff --git a/src/bin/pg_basebackup/bbstreamer_tar.c b/src/bin/pg_basebackup/bbstreamer_tar.c
index a778e620cc..dec71ea65b 100644
--- a/src/bin/pg_basebackup/bbstreamer_tar.c
+++ b/src/bin/pg_basebackup/bbstreamer_tar.c
@@ -345,7 +345,7 @@ bbstreamer_tar_parser_free(bbstreamer *streamer)
 }
 
 /*
- * Create an bbstreamer that can generate a tar archive.
+ * Create a bbstreamer that can generate a tar archive.
  *
  * This is intended to be usable either for generating a brand-new tar archive
  * or for modifying one on the fly. The input should be a series of typed
diff --git a/src/bin/pg_combinebackup/pg_combinebackup.c b/src/bin/pg_combinebackup/pg_combinebackup.c
index 2788c78fdd..08ef397a67 100644
--- a/src/bin/pg_combinebackup/pg_combinebackup.c
+++ b/src/bin/pg_combinebackup/pg_combinebackup.c
@@ -1156,7 +1156,7 @@ remember_to_cleanup_directory(char *target_path, bool rmtopdir)
 }
 
 /*
- * Empty out the list of directories scheduled for cleanup a exit.
+ * Empty out the list of directories scheduled for cleanup at exit.
  *
  * We want to remove the output directories only on a failure, so call this
  * function when we know that the operation has succeeded.
diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c
index c98cfa6084..e7a4d006e1 100644
--- a/src/interfaces/libpq/fe-secure-openssl.c
+++ b/src/interfaces/libpq/fe-secure-openssl.c
@@ -1655,7 +1655,7 @@ pgtls_close(PGconn *conn)
 	{
 		/*
 		 * In the non-SSL case, just remove the crypto callbacks if the
-		 * connection has then loaded.  This code path has no dependency on
+		 * connection has them loaded.  This code path has no dependency on
 		 * any pending SSL calls.
 		 */
 		if (conn->crypto_loaded)
diff --git a/src/test/modules/test_resowner/test_resowner_many.c b/src/test/modules/test_resowner/test_resowner_many.c
index 4722c66267..7808c9e5df 100644
--- a/src/test/modules/test_resowner/test_resowner_many.c
+++ b/src/test/modules/test_resowner/test_resowner_many.c
@@ -196,7 +196,7 @@ GetTotalResourceCount(ManyTestResourceKind *kinds, int nkinds)
  * Remember lots of resources, belonging to 'nkinds' different resource types
  * with different priorities.  Then forget some of them, and finally, release
  * the resource owner.  We use a custom resource type that performs various
- * sanity checks to verify that all the the resources are released, and in the
+ * sanity checks to verify that all the resources are released, and in the
  * correct order.
  */
 PG_FUNCTION_INFO_V1(test_resowner_many);
diff --git a/src/test/regress/expected/aggregates.out b/src/test/regress/expected/aggregates.out
index 50695d83a2..56c361ccef 100644
--- a/src/test/regress/expected/aggregates.out
+++ b/src/test/regress/expected/aggregates.out
@@ -2889,7 +2889,7 @@ GROUP BY c1.w, c1.z;
 RESET enable_nestloop;
 RESET enable_hashjoin;
 DROP TABLE group_agg_pk;
--- Test the case where the the ordering of scan matches the ordering within the
+-- Test the case where the ordering of the scan matches the ordering within the
 -- aggregate but cannot be found in the group-by list
 CREATE TABLE agg_sort_order (c1 int PRIMARY KEY, c2 int);
 CREATE UNIQUE INDEX agg_sort_order_c2_idx ON agg_sort_order(c2);
diff --git a/src/test/regress/sql/aggregates.sql b/src/test/regress/sql/aggregates.sql
index 2905848ead..d28338ba3d 100644
--- a/src/test/regress/sql/aggregates.sql
+++ b/src/test/regress/sql/aggregates.sql
@@ -1257,7 +1257,7 @@ RESET enable_nestloop;
 RESET enable_hashjoin;
 DROP TABLE group_agg_pk;
 
--- Test the case where the the ordering of scan matches the ordering within the
+-- Test the case where the ordering of the scan matches the ordering within the
 -- aggregate but cannot be found in the group-by list
 CREATE TABLE agg_sort_order (c1 int PRIMARY KEY, c2 int);
 CREATE UNIQUE INDEX agg_sort_order_c2_idx ON agg_sort_order(c2);
-- 
2.39.2

From f225794bb3e9bdb11821574e6750c4e92a9e29df Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas <heikki.linnakan...@iki.fi>
Date: Mon, 8 Apr 2024 03:00:53 +0300
Subject: [PATCH 2/2] fix func name

---
 src/interfaces/libpq/fe-secure-openssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c
index e7a4d006e1..7cbb11a485 100644
--- a/src/interfaces/libpq/fe-secure-openssl.c
+++ b/src/interfaces/libpq/fe-secure-openssl.c
@@ -1587,7 +1587,7 @@ open_client_SSL(PGconn *conn)
 
 	/*
 	 * We already checked the server certificate in initialize_SSL() using
-	 * SSL_CTX_set_verify(), if root.crt exists.
+	 * SSL_set_verify(), if root.crt exists.
 	 */
 
 	/* get server certificate */
-- 
2.39.2

Reply via email to