From b46ea5c713dd30910bebc8a929ff28de619b6e38 Mon Sep 17 00:00:00 2001
From: Otto Kekalainen <ottoke@amazon.com>
Date: Wed, 2 Mar 2022 18:54:06 -0800
Subject: [PATCH v1] Fix various spelling errors

Most fixes are in comments and have no effect on functionality.
Some fixes are also in variable names but they should be safe to change,
as the change is consistent in all occurrences of the variable.
---
 config/pkg.m4                                     | 2 +-
 contrib/pageinspect/expected/gist.out             | 2 +-
 contrib/pageinspect/sql/gist.sql                  | 2 +-
 doc/src/sgml/config.sgml                          | 2 +-
 doc/src/sgml/ref/pg_basebackup.sgml               | 2 +-
 src/backend/access/heap/pruneheap.c               | 2 +-
 src/backend/access/transam/xlog.c                 | 2 +-
 src/backend/catalog/index.c                       | 2 +-
 src/backend/commands/explain.c                    | 6 +++---
 src/backend/replication/basebackup_sink.c         | 4 ++--
 src/backend/utils/adt/tsrank.c                    | 2 +-
 src/bin/pg_basebackup/pg_basebackup.c             | 2 +-
 src/bin/pg_basebackup/t/010_pg_basebackup.pl      | 2 +-
 src/bin/pg_verifybackup/t/008_untar.pl            | 2 +-
 src/bin/pg_verifybackup/t/010_client_untar.pl     | 2 +-
 src/bin/pgbench/pgbench.c                         | 2 +-
 src/include/libpq/sasl.h                          | 2 +-
 src/test/regress/expected/create_function_sql.out | 2 +-
 src/test/regress/expected/create_table.out        | 2 +-
 src/test/regress/expected/object_address.out      | 2 +-
 src/test/regress/sql/create_function_sql.sql      | 2 +-
 src/test/regress/sql/create_table.sql             | 2 +-
 src/test/regress/sql/object_address.sql           | 2 +-
 src/test/subscription/t/001_rep_changes.pl        | 2 +-
 24 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/config/pkg.m4 b/config/pkg.m4
index 13a8890178..f9075e56c8 100644
--- a/config/pkg.m4
+++ b/config/pkg.m4
@@ -86,7 +86,7 @@ dnl Check to see whether a particular set of modules exists. Similar to
 dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
 dnl
 dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-dnl only at the first occurence in configure.ac, so if the first place
+dnl only at the first occurrence in configure.ac, so if the first place
 dnl it's called might be skipped (such as if it is within an "if", you
 dnl have to call PKG_CHECK_EXISTS manually
 AC_DEFUN([PKG_CHECK_EXISTS],
diff --git a/contrib/pageinspect/expected/gist.out b/contrib/pageinspect/expected/gist.out
index b26b56ba15..93abfcdd5e 100644
--- a/contrib/pageinspect/expected/gist.out
+++ b/contrib/pageinspect/expected/gist.out
@@ -52,7 +52,7 @@ SELECT * FROM gist_page_items(get_raw_page('test_gist_idx', 1), 'test_gist_idx')
 (5 rows)
 
 -- gist_page_items_bytea prints the raw key data as a bytea. The output of that is
--- platform-dependent (endianess), so omit the actual key data from the output.
+-- platform-dependent (endianness), so omit the actual key data from the output.
 SELECT itemoffset, ctid, itemlen FROM gist_page_items_bytea(get_raw_page('test_gist_idx', 0));
  itemoffset |   ctid    | itemlen 
 ------------+-----------+---------
diff --git a/contrib/pageinspect/sql/gist.sql b/contrib/pageinspect/sql/gist.sql
index 1560d1e15c..3e83239a9d 100644
--- a/contrib/pageinspect/sql/gist.sql
+++ b/contrib/pageinspect/sql/gist.sql
@@ -23,7 +23,7 @@ SELECT * FROM gist_page_items(get_raw_page('test_gist_idx', 0), 'test_gist_idx')
 SELECT * FROM gist_page_items(get_raw_page('test_gist_idx', 1), 'test_gist_idx') LIMIT 5;
 
 -- gist_page_items_bytea prints the raw key data as a bytea. The output of that is
--- platform-dependent (endianess), so omit the actual key data from the output.
+-- platform-dependent (endianness), so omit the actual key data from the output.
 SELECT itemoffset, ctid, itemlen FROM gist_page_items_bytea(get_raw_page('test_gist_idx', 0));
 
 DROP TABLE test_gist;
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 7ed8c82a9d..e68a11399c 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -4743,7 +4743,7 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
         log file by reducing the value of this parameter. On a system with
         low WAL activity, increasing it reduces the amount of requests necessary
         to access WAL archives, something useful for example in cloud
-        environments where the amount of times an infrastructure is accessed
+        environments where the number of times an infrastructure is accessed
         is taken into account.
        </para>
       </listitem>
diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index 53aa40dcd1..1c260caccf 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -440,7 +440,7 @@ PostgreSQL documentation
         <literal>-Xstream</literal>, <literal>pg_wal.tar</literal> will
         be compressed using <literal>gzip</literal> if client-side gzip
         compression is selected, but will not be compressed if server-side
-        compresion or LZ4 compresion is selected.
+        compression or LZ4 compression is selected.
        </para>
       </listitem>
      </varlistentry>
diff --git a/src/backend/access/heap/pruneheap.c b/src/backend/access/heap/pruneheap.c
index b6500763a5..4656f1b3db 100644
--- a/src/backend/access/heap/pruneheap.c
+++ b/src/backend/access/heap/pruneheap.c
@@ -69,7 +69,7 @@ typedef struct
 	/*
 	 * Tuple visibility is only computed once for each tuple, for correctness
 	 * and efficiency reasons; see comment in heap_page_prune() for
-	 * details. This is of type int8[,] intead of HTSV_Result[], so we can use
+	 * details. This is of type int8[,] instead of HTSV_Result[], so we can use
 	 * -1 to indicate no visibility has been computed, e.g. for LP_DEAD items.
 	 *
 	 * Same indexing as ->marked.
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 0d2bd7a357..ee15be558e 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -5869,7 +5869,7 @@ GetRedoRecPtr(void)
  * full-page image to be included in the WAL record.
  *
  * The returned values are cached copies from backend-private memory, and
- * possibly out-of-date or, indeed, uninitalized, in which case they will
+ * possibly out-of-date or, indeed, uninitialized, in which case they will
  * be InvalidXLogRecPtr and false, respectively.  XLogInsertRecord will
  * re-check them against up-to-date values, while holding the WAL insert lock.
  */
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 5e3fc2b35d..e43117ffef 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -918,7 +918,7 @@ index_create(Relation heapRelation,
 			indexRelationId = binary_upgrade_next_index_pg_class_oid;
 			binary_upgrade_next_index_pg_class_oid = InvalidOid;
 
-			/* Overide the index relfilenode */
+			/* Override the index relfilenode */
 			if ((relkind == RELKIND_INDEX) &&
 				(!OidIsValid(binary_upgrade_next_index_pg_class_relfilenode)))
 				ereport(ERROR,
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index de81379da3..9f632285b6 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -3102,7 +3102,7 @@ show_memoize_info(MemoizeState *mstate, List *ancestors, ExplainState *es)
 	ListCell   *lc;
 	List	   *context;
 	StringInfoData keystr;
-	char	   *seperator = "";
+	char	   *separator = "";
 	bool		useprefix;
 	int64		memPeakKb;
 
@@ -3123,11 +3123,11 @@ show_memoize_info(MemoizeState *mstate, List *ancestors, ExplainState *es)
 	{
 		Node	   *expr = (Node *) lfirst(lc);
 
-		appendStringInfoString(&keystr, seperator);
+		appendStringInfoString(&keystr, separator);
 
 		appendStringInfoString(&keystr, deparse_expression(expr, context,
 														   useprefix, false));
-		seperator = ", ";
+		separator = ", ";
 	}
 
 	if (es->format != EXPLAIN_FORMAT_TEXT)
diff --git a/src/backend/replication/basebackup_sink.c b/src/backend/replication/basebackup_sink.c
index 47ba50c2f8..81353f8f4d 100644
--- a/src/backend/replication/basebackup_sink.c
+++ b/src/backend/replication/basebackup_sink.c
@@ -18,7 +18,7 @@
  * Forward begin_backup callback.
  *
  * Only use this implementation if you want the bbsink you're implementing to
- * share a buffer with the succesor bbsink.
+ * share a buffer with the successor bbsink.
  */
 void
 bbsink_forward_begin_backup(bbsink *sink)
@@ -43,7 +43,7 @@ bbsink_forward_begin_archive(bbsink *sink, const char *archive_name)
 /*
  * Forward archive_contents callback.
  *
- * Code that wants to use this should initalize its own bbs_buffer and
+ * Code that wants to use this should initialize its own bbs_buffer and
  * bbs_buffer_length fields to the values from the successor sink. In cases
  * where the buffer isn't shared, the data needs to be copied before forwarding
  * the callback. We don't do try to do that here, because there's really no
diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c
index cd8aff0ad2..3858fc5928 100644
--- a/src/backend/utils/adt/tsrank.c
+++ b/src/backend/utils/adt/tsrank.c
@@ -337,7 +337,7 @@ calc_rank_or(const float *w, TSVector t, TSQuery q)
 			}
 /*
 			limit (sum(1/i^2),i=1,inf) = pi^2/6
-			resj = sum(wi/i^2),i=1,noccurence,
+			resj = sum(wi/i^2),i=1,noccurrence,
 			wi - should be sorted desc,
 			don't sort for now, just choose maximum weight. This should be corrected
 			Oleg Bartunov
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index c1ed7aeeee..dfd82a8645 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -1672,7 +1672,7 @@ GetCopyDataEnd(size_t r, char *copybuf, size_t cursor)
  *
  * As a debugging aid, we try to give some hint about what kind of message
  * provoked the failure. Perhaps this is not detailed enough, but it's not
- * clear that it's worth expending any more code on what shoud be a
+ * clear that it's worth expending any more code on what should be a
  * can't-happen case.
  */
 static void
diff --git a/src/bin/pg_basebackup/t/010_pg_basebackup.pl b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
index 8cb8cfe045..ce80753c75 100644
--- a/src/bin/pg_basebackup/t/010_pg_basebackup.pl
+++ b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
@@ -287,7 +287,7 @@ is(scalar(@tblspc_tars), 1, 'one tablespace tar was created');
 SKIP:
 {
 	my $tar = $ENV{TAR};
-	# don't check for a working tar here, to accomodate various odd
+	# don't check for a working tar here, to accommodate various odd
 	# cases such as AIX. If tar doesn't work the init_from_backup below
 	# will fail.
 	skip "no tar program available", 1
diff --git a/src/bin/pg_verifybackup/t/008_untar.pl b/src/bin/pg_verifybackup/t/008_untar.pl
index 383203d0b8..cd441b9b7e 100644
--- a/src/bin/pg_verifybackup/t/008_untar.pl
+++ b/src/bin/pg_verifybackup/t/008_untar.pl
@@ -87,7 +87,7 @@ for my $tc (@test_configuration)
 
 		SKIP: {
 			my $tar = $ENV{TAR};
-			# don't check for a working tar here, to accomodate various odd
+			# don't check for a working tar here, to accommodate various odd
 			# cases such as AIX. If tar doesn't work the init_from_backup below
 			# will fail.
 			skip "no tar program available", 1
diff --git a/src/bin/pg_verifybackup/t/010_client_untar.pl b/src/bin/pg_verifybackup/t/010_client_untar.pl
index 3616529390..2ae586781b 100644
--- a/src/bin/pg_verifybackup/t/010_client_untar.pl
+++ b/src/bin/pg_verifybackup/t/010_client_untar.pl
@@ -88,7 +88,7 @@ for my $tc (@test_configuration)
 
 		SKIP: {
 			my $tar = $ENV{TAR};
-			# don't check for a working tar here, to accomodate various odd
+			# don't check for a working tar here, to accommodate various odd
 			# cases such as AIX. If tar doesn't work the init_from_backup below
 			# will fail.
 			skip "no tar program available", 1
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index 4ebe5e6ea4..000ffc4a5c 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -4183,7 +4183,7 @@ initGenerateDataClientSide(PGconn *con)
 	 * accounts is big enough to be worth using COPY and tracking runtime
 	 */
 
-	/* use COPY with FREEZE on v14 and later without partioning */
+	/* use COPY with FREEZE on v14 and later without partitioning */
 	if (partitions == 0 && PQserverVersion(con) >= 140000)
 		copy_statement = "copy pgbench_accounts from stdin with (freeze on)";
 	else
diff --git a/src/include/libpq/sasl.h b/src/include/libpq/sasl.h
index 71cc0dc251..39ccf8f0e3 100644
--- a/src/include/libpq/sasl.h
+++ b/src/include/libpq/sasl.h
@@ -62,7 +62,7 @@ typedef struct pg_be_sasl_mech
 	 * must return a pointer to its allocated state, which will be passed
 	 * as-is as the first argument to the other callbacks.
 	 *
-	 * Input paramters:
+	 * Input parameters:
 	 *
 	 *	port:        The client Port.
 	 *
diff --git a/src/test/regress/expected/create_function_sql.out b/src/test/regress/expected/create_function_sql.out
index f956955464..a31daffbf3 100644
--- a/src/test/regress/expected/create_function_sql.out
+++ b/src/test/regress/expected/create_function_sql.out
@@ -279,7 +279,7 @@ CREATE FUNCTION functest_S_13() RETURNS boolean
         SELECT 1;
         SELECT false;
     END;
--- check display of function argments in sub-SELECT
+-- check display of function arguments in sub-SELECT
 CREATE TABLE functest1 (i int);
 CREATE FUNCTION functest_S_16(a int, b int) RETURNS void
     LANGUAGE SQL
diff --git a/src/test/regress/expected/create_table.out b/src/test/regress/expected/create_table.out
index 02d0999580..4407a017a9 100644
--- a/src/test/regress/expected/create_table.out
+++ b/src/test/regress/expected/create_table.out
@@ -811,7 +811,7 @@ create table parted_notnull_inh_test1 partition of parted_notnull_inh_test (a no
 insert into parted_notnull_inh_test (b) values (null);
 ERROR:  null value in column "b" of relation "parted_notnull_inh_test1" violates not-null constraint
 DETAIL:  Failing row contains (1, null).
--- note that while b's default is overriden, a's default is preserved
+-- note that while b's default is overridden, a's default is preserved
 \d parted_notnull_inh_test1
       Table "public.parted_notnull_inh_test1"
  Column |  Type   | Collation | Nullable | Default 
diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out
index a9e7f2eed5..4117fc27c9 100644
--- a/src/test/regress/expected/object_address.out
+++ b/src/test/regress/expected/object_address.out
@@ -558,7 +558,7 @@ WITH objects (classid, objid, objsubid) AS (VALUES
     ('pg_namespace'::regclass, 0, 0), -- no schema
     ('pg_statistic_ext'::regclass, 0, 0), -- no statistics
     ('pg_ts_parser'::regclass, 0, 0), -- no TS parser
-    ('pg_ts_dict'::regclass, 0, 0), -- no TS dictionnary
+    ('pg_ts_dict'::regclass, 0, 0), -- no TS dictionary
     ('pg_ts_template'::regclass, 0, 0), -- no TS template
     ('pg_ts_config'::regclass, 0, 0), -- no TS configuration
     ('pg_authid'::regclass, 0, 0), -- no role
diff --git a/src/test/regress/sql/create_function_sql.sql b/src/test/regress/sql/create_function_sql.sql
index 4512456eae..cc0ccd8db1 100644
--- a/src/test/regress/sql/create_function_sql.sql
+++ b/src/test/regress/sql/create_function_sql.sql
@@ -180,7 +180,7 @@ CREATE FUNCTION functest_S_13() RETURNS boolean
         SELECT false;
     END;
 
--- check display of function argments in sub-SELECT
+-- check display of function arguments in sub-SELECT
 CREATE TABLE functest1 (i int);
 CREATE FUNCTION functest_S_16(a int, b int) RETURNS void
     LANGUAGE SQL
diff --git a/src/test/regress/sql/create_table.sql b/src/test/regress/sql/create_table.sql
index 37dac6b5fb..5175f404f7 100644
--- a/src/test/regress/sql/create_table.sql
+++ b/src/test/regress/sql/create_table.sql
@@ -559,7 +559,7 @@ CREATE TABLE part_c_1_10 PARTITION OF part_c FOR VALUES FROM (1) TO (10);
 create table parted_notnull_inh_test (a int default 1, b int not null default 0) partition by list (a);
 create table parted_notnull_inh_test1 partition of parted_notnull_inh_test (a not null, b default 1) for values in (1);
 insert into parted_notnull_inh_test (b) values (null);
--- note that while b's default is overriden, a's default is preserved
+-- note that while b's default is overridden, a's default is preserved
 \d parted_notnull_inh_test1
 drop table parted_notnull_inh_test;
 
diff --git a/src/test/regress/sql/object_address.sql b/src/test/regress/sql/object_address.sql
index 2f40156eb4..acd0468a9d 100644
--- a/src/test/regress/sql/object_address.sql
+++ b/src/test/regress/sql/object_address.sql
@@ -259,7 +259,7 @@ WITH objects (classid, objid, objsubid) AS (VALUES
     ('pg_namespace'::regclass, 0, 0), -- no schema
     ('pg_statistic_ext'::regclass, 0, 0), -- no statistics
     ('pg_ts_parser'::regclass, 0, 0), -- no TS parser
-    ('pg_ts_dict'::regclass, 0, 0), -- no TS dictionnary
+    ('pg_ts_dict'::regclass, 0, 0), -- no TS dictionary
     ('pg_ts_template'::regclass, 0, 0), -- no TS template
     ('pg_ts_config'::regclass, 0, 0), -- no TS configuration
     ('pg_authid'::regclass, 0, 0), -- no role
diff --git a/src/test/subscription/t/001_rep_changes.pl b/src/test/subscription/t/001_rep_changes.pl
index af0cff6a30..eca1c63335 100644
--- a/src/test/subscription/t/001_rep_changes.pl
+++ b/src/test/subscription/t/001_rep_changes.pl
@@ -418,7 +418,7 @@ is( $result, qq(11.11|baz|1
 # application_name to ensure that the walsender is (re)started.
 #
 # Not all of these are registered as tests as we need to poll for a change
-# but the test suite will fail none the less when something goes wrong.
+# but the test suite will fail nonetheless when something goes wrong.
 my $oldpid = $node_publisher->safe_psql('postgres',
 	"SELECT pid FROM pg_stat_replication WHERE application_name = 'tap_sub' AND state = 'streaming';"
 );
-- 
2.33.0

