Some more accumulated/new typos.
>From 6c79a0d4e0251dbbac38babb60bb2d0fbae3da8d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Wed, 11 Jan 2023 12:52:25 -0600
Subject: [PATCH 01/10] use "an SQL" rather than a SQL

Per 04539e
---
 doc/src/sgml/ecpg.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/ecpg.sgml b/doc/src/sgml/ecpg.sgml
index a76cf3538f1..f52165165dc 100644
--- a/doc/src/sgml/ecpg.sgml
+++ b/doc/src/sgml/ecpg.sgml
@@ -1506,7 +1506,7 @@ EXEC SQL TYPE serial_t IS long;
      </para>
 
      <para>
-      Any word you declare as a typedef cannot be used as a SQL keyword
+      Any word you declare as a typedef cannot be used as an SQL keyword
       in <literal>EXEC SQL</literal> commands later in the same program.
       For example, this won't work:
 <programlisting>
@@ -1518,7 +1518,7 @@ EXEC SQL START TRANSACTION;
 </programlisting>
       ECPG will report a syntax error for <literal>START
       TRANSACTION</literal>, because it no longer
-      recognizes <literal>START</literal> as a SQL keyword,
+      recognizes <literal>START</literal> as an SQL keyword,
       only as a typedef.
       (If you have such a conflict, and renaming the typedef
       seems impractical, you could write the SQL command
@@ -1530,7 +1530,7 @@ EXEC SQL START TRANSACTION;
        In <productname>PostgreSQL</productname> releases before v16, use
        of SQL keywords as typedef names was likely to result in syntax
        errors associated with use of the typedef itself, rather than use
-       of the name as a SQL keyword.  The new behavior is less likely to
+       of the name as an SQL keyword.  The new behavior is less likely to
        cause problems when an existing ECPG application is recompiled in
        a new <productname>PostgreSQL</productname> release with new
        keywords.
-- 
2.25.1

>From fef49b822bad849722ec9b043ffd676c80492d0d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Sun, 15 Jan 2023 17:00:06 -0600
Subject: [PATCH 02/10] comment typos

---
 src/backend/commands/dbcommands.c              | 2 +-
 src/backend/executor/execMain.c                | 2 +-
 src/backend/jit/llvm/llvmjit_inline.cpp        | 2 +-
 src/backend/replication/logical/snapbuild.c    | 2 +-
 src/backend/replication/walsender.c            | 6 +++---
 src/bin/pg_dump/pg_backup_custom.c             | 2 +-
 src/bin/pg_dump/pg_dumpall.c                   | 2 +-
 src/include/lib/ilist.h                        | 2 +-
 src/test/regress/expected/alter_table.out      | 2 +-
 src/test/regress/expected/create_procedure.out | 2 +-
 src/test/regress/sql/alter_table.sql           | 2 +-
 src/test/regress/sql/create_procedure.sql      | 2 +-
 src/test/subscription/t/031_column_list.pl     | 2 +-
 13 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 1f4ce2fb9cf..ef05633bb05 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -3090,7 +3090,7 @@ dbase_redo(XLogReaderState *record)
 
 		/*
 		 * There's a case where the copy source directory is missing for the
-		 * same reason above.  Create the emtpy source directory so that
+		 * same reason above.  Create the empty source directory so that
 		 * copydir below doesn't fail.  The directory will be dropped soon by
 		 * recovery.
 		 */
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index a5115b9c1f7..39bfb48dc22 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -134,7 +134,7 @@ ExecutorStart(QueryDesc *queryDesc, int eflags)
 	/*
 	 * In some cases (e.g. an EXECUTE statement) a query execution will skip
 	 * parse analysis, which means that the query_id won't be reported.  Note
-	 * that it's harmless to report the query_id multiple time, as the call
+	 * that it's harmless to report the query_id multiple times, as the call
 	 * will be ignored if the top level query_id has already been reported.
 	 */
 	pgstat_report_query_id(queryDesc->plannedstmt->queryId, false);
diff --git a/src/backend/jit/llvm/llvmjit_inline.cpp b/src/backend/jit/llvm/llvmjit_inline.cpp
index dc35e002f51..c765add8564 100644
--- a/src/backend/jit/llvm/llvmjit_inline.cpp
+++ b/src/backend/jit/llvm/llvmjit_inline.cpp
@@ -753,7 +753,7 @@ function_inlinable(llvm::Function &F,
 		/* import referenced function itself */
 		importVars.insert(referencedFunction->getName());
 
-		/* import referenced function and its dependants */
+		/* import referenced function and its dependents */
 		for (auto& recImportVar : recImportVars)
 			importVars.insert(recImportVar.first());
 	}
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index 829c5681120..62542827e4b 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -1816,7 +1816,7 @@ SnapBuildSerialize(SnapBuild *builder, XLogRecPtr lsn)
 	fsync_fname("pg_logical/snapshots", true);
 
 	/*
-	 * Now there's no way we can loose the dumped state anymore, remember this
+	 * Now there's no way we can lose the dumped state anymore, remember this
 	 * as a serialization point.
 	 */
 	builder->last_serialized_snapshot = lsn;
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index 4ed3747e3f9..75e8363e248 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -2050,9 +2050,9 @@ PhysicalConfirmReceivedLocation(XLogRecPtr lsn)
 
 	/*
 	 * One could argue that the slot should be saved to disk now, but that'd
-	 * be energy wasted - the worst lost information can do here is give us
-	 * wrong information in a statistics view - we'll just potentially be more
-	 * conservative in removing files.
+	 * be energy wasted - the worst thing lost information could cause here is
+	 * to give wrong information in a statistics view - we'll just potentially
+	 * be more conservative in removing files.
 	 */
 }
 
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index d1e54644a94..7529367a7b9 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -99,7 +99,7 @@ static size_t _CustomReadFunc(ArchiveHandle *AH, char **buf, size_t *buflen);
  *	It's task is to create any extra archive context (using AH->formatData),
  *	and to initialize the supported function pointers.
  *
- *	It should also prepare whatever it's input source is for reading/writing,
+ *	It should also prepare whatever its input source is for reading/writing,
  *	and in the case of a read mode connection, it should load the Header & TOC.
  */
 void
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index fbd1c6fc85b..cd421c59443 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -995,7 +995,7 @@ dumpRoleMembership(PGconn *conn)
 		fprintf(OPF, "--\n-- Role memberships\n--\n\n");
 
 	/*
-	 * We can't dump these GRANT commands in arbitary order, because a role
+	 * We can't dump these GRANT commands in arbitrary order, because a role
 	 * that is named as a grantor must already have ADMIN OPTION on the
 	 * role for which it is granting permissions, except for the boostrap
 	 * superuser, who can always be named as the grantor.
diff --git a/src/include/lib/ilist.h b/src/include/lib/ilist.h
index e03aa1c683b..095107a99c4 100644
--- a/src/include/lib/ilist.h
+++ b/src/include/lib/ilist.h
@@ -39,7 +39,7 @@
  * operations that can be done without branches (and thus faster) on lists
  * that use circular representation.  However, it is often convenient to
  * initialize list headers to zeroes rather than setting them up with an
- * explicit initialization function, so we also allow the NULL initalization.
+ * explicit initialization function, so we also allow the NULL initialization.
  *
  * EXAMPLES
  *
diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out
index 9e5f6c1a804..97bfc3475b6 100644
--- a/src/test/regress/expected/alter_table.out
+++ b/src/test/regress/expected/alter_table.out
@@ -2566,7 +2566,7 @@ select * from at_view_2;
 drop view at_view_2;
 drop view at_view_1;
 drop table at_base_table;
--- check adding a column not iself requiring a rewrite, together with
+-- check adding a column not itself requiring a rewrite, together with
 -- a column requiring a default (bug #16038)
 -- ensure that rewrites aren't silently optimized away, removing the
 -- value of the test
diff --git a/src/test/regress/expected/create_procedure.out b/src/test/regress/expected/create_procedure.out
index 46c827f9791..f2a677fa552 100644
--- a/src/test/regress/expected/create_procedure.out
+++ b/src/test/regress/expected/create_procedure.out
@@ -100,7 +100,7 @@ SELECT * FROM cp_test ORDER BY b COLLATE "C";
  1 | xyzzy
 (4 rows)
 
--- utitlity functions currently not supported here
+-- utility functions currently not supported here
 CREATE PROCEDURE ptestx()
 LANGUAGE SQL
 BEGIN ATOMIC
diff --git a/src/test/regress/sql/alter_table.sql b/src/test/regress/sql/alter_table.sql
index f58b2f75d5b..b5d57a771ae 100644
--- a/src/test/regress/sql/alter_table.sql
+++ b/src/test/regress/sql/alter_table.sql
@@ -1635,7 +1635,7 @@ drop view at_view_2;
 drop view at_view_1;
 drop table at_base_table;
 
--- check adding a column not iself requiring a rewrite, together with
+-- check adding a column not itself requiring a rewrite, together with
 -- a column requiring a default (bug #16038)
 
 -- ensure that rewrites aren't silently optimized away, removing the
diff --git a/src/test/regress/sql/create_procedure.sql b/src/test/regress/sql/create_procedure.sql
index 75cc0fcf2a6..35b872779ef 100644
--- a/src/test/regress/sql/create_procedure.sql
+++ b/src/test/regress/sql/create_procedure.sql
@@ -42,7 +42,7 @@ CALL ptest1s('b');
 
 SELECT * FROM cp_test ORDER BY b COLLATE "C";
 
--- utitlity functions currently not supported here
+-- utility functions currently not supported here
 CREATE PROCEDURE ptestx()
 LANGUAGE SQL
 BEGIN ATOMIC
diff --git a/src/test/subscription/t/031_column_list.pl b/src/test/subscription/t/031_column_list.pl
index 7c313e26eea..fd77757352a 100644
--- a/src/test/subscription/t/031_column_list.pl
+++ b/src/test/subscription/t/031_column_list.pl
@@ -1034,7 +1034,7 @@ is( $node_subscriber->safe_psql('postgres', "SELECT * FROM s1.t ORDER BY a"),
 4|5|6),
 	'two publications, publishing the same relation');
 
-# Now resync the subcription, but with publications in the opposite order.
+# Now resync the subscription, but with publications in the opposite order.
 # The result should be the same.
 
 $node_subscriber->safe_psql(
-- 
2.25.1

>From 226d9e218b2bfb6e7421dd50e53cfec4c7857ef4 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Sat, 28 Jan 2023 12:48:13 -0600
Subject: [PATCH 03/10] Avoid hardcoded reference (only) to .gz

This should've been updated at:
dab298471ff2f91f33bc25bfb73e435d3ab02148
751b8d23b788580bbff7463e3959f9a92a95b28a

Ideally it doesn't reference any specific compression algorithm at all.
---
 src/bin/pg_basebackup/pg_basebackup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 1d3ef2c694e..414771ec87c 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -2015,8 +2015,8 @@ BaseBackup(char *compression_algorithm, char *compression_detail,
 			 * If we write the data out to a tar file, it will be named
 			 * base.tar if it's the main data directory or <tablespaceoid>.tar
 			 * if it's for another tablespace. CreateBackupStreamer() will
-			 * arrange to add .gz to the archive name if pg_basebackup is
-			 * performing compression.
+			 * arrange to add an extension to the archive name if pg_basebackup
+			 * is performing compression.
 			 */
 			if (PQgetisnull(res, i, 0))
 			{
-- 
2.25.1

>From b8296980b51629418336ba1c0a4ae3a57b73d8f9 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Tue, 17 Jan 2023 22:28:42 -0600
Subject: [PATCH 04/10] duplicate words

---
 contrib/postgres_fdw/deparse.c        | 2 +-
 doc/src/sgml/ref/create_database.sgml | 2 +-
 doc/src/sgml/ref/create_schema.sgml   | 2 +-
 src/include/partitioning/partdesc.h   | 2 +-
 src/include/port/simd.h               | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c
index 8a847deb13b..09d6dd60ddc 100644
--- a/contrib/postgres_fdw/deparse.c
+++ b/contrib/postgres_fdw/deparse.c
@@ -2412,7 +2412,7 @@ deparseAnalyzeInfoSql(StringInfo buf, Relation rel)
  *
  * We could also do "ORDER BY random() LIMIT x", which would always pick
  * the expected number of rows, but it requires sorting so it may be much
- * more expensive (particularly on large tables, which is what what the
+ * more expensive (particularly on large tables, which is what the
  * remote sampling is meant to improve).
  */
 void
diff --git a/doc/src/sgml/ref/create_database.sgml b/doc/src/sgml/ref/create_database.sgml
index f3df2def864..91c39c52303 100644
--- a/doc/src/sgml/ref/create_database.sgml
+++ b/doc/src/sgml/ref/create_database.sgml
@@ -89,7 +89,7 @@ CREATE DATABASE <replaceable class="parameter">name</replaceable>
         The role name of the user who will own the new database,
         or <literal>DEFAULT</literal> to use the default (namely, the
         user executing the command).  To create a database owned by another
-        role, you must must be able to <literal>SET ROLE</literal> to that
+        role, you must be able to <literal>SET ROLE</literal> to that
         role.
        </para>
       </listitem>
diff --git a/doc/src/sgml/ref/create_schema.sgml b/doc/src/sgml/ref/create_schema.sgml
index 04b0c28731e..ed69298ccc6 100644
--- a/doc/src/sgml/ref/create_schema.sgml
+++ b/doc/src/sgml/ref/create_schema.sgml
@@ -89,7 +89,7 @@ CREATE SCHEMA IF NOT EXISTS AUTHORIZATION <replaceable class="parameter">role_sp
        <para>
         The role name of the user who will own the new schema.  If omitted,
         defaults to the user executing the command.  To create a schema
-        owned by another role, you must must be able to
+        owned by another role, you must be able to
         <literal>SET ROLE</literal> to that role.
        </para>
       </listitem>
diff --git a/src/include/partitioning/partdesc.h b/src/include/partitioning/partdesc.h
index 7d71fb6e931..e157eae9c1e 100644
--- a/src/include/partitioning/partdesc.h
+++ b/src/include/partitioning/partdesc.h
@@ -31,7 +31,7 @@ typedef struct PartitionDescData
 	int			nparts;			/* Number of partitions */
 	bool		detached_exist; /* Are there any detached partitions? */
 	Oid		   *oids;			/* Array of 'nparts' elements containing
-								 * partition OIDs in order of the their bounds */
+								 * partition OIDs in order of their bounds */
 	bool	   *is_leaf;		/* Array of 'nparts' elements storing whether
 								 * the corresponding 'oids' element belongs to
 								 * a leaf partition or not */
diff --git a/src/include/port/simd.h b/src/include/port/simd.h
index c836360d4b7..1fa6c3bc6c4 100644
--- a/src/include/port/simd.h
+++ b/src/include/port/simd.h
@@ -345,7 +345,7 @@ vector8_ssub(const Vector8 v1, const Vector8 v2)
 #endif							/* ! USE_NO_SIMD */
 
 /*
- * Return a vector with all bits set in each lane where the the corresponding
+ * Return a vector with all bits set in each lane where the corresponding
  * lanes in the inputs are equal.
  */
 #ifndef USE_NO_SIMD
-- 
2.25.1

>From fe2c8749fd0ca92a433e5beca00014266074ff4d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Thu, 12 Jan 2023 21:23:09 -0600
Subject: [PATCH 05/10] WIP: avoid whitespace preceding/following 'else'

---
 contrib/dblink/dblink.c                                      | 1 -
 contrib/spi/refint.c                                         | 1 -
 src/backend/commands/functioncmds.c                          | 1 -
 src/backend/commands/tablecmds.c                             | 1 -
 src/backend/executor/nodeTidrangescan.c                      | 1 -
 src/backend/libpq/be-secure-openssl.c                        | 1 -
 src/backend/optimizer/geqo/geqo_erx.c                        | 1 -
 src/backend/optimizer/geqo/geqo_pmx.c                        | 1 -
 src/backend/optimizer/geqo/geqo_pool.c                       | 1 -
 src/backend/optimizer/util/clauses.c                         | 1 -
 src/backend/replication/logical/origin.c                     | 1 -
 src/backend/replication/logical/snapbuild.c                  | 1 -
 src/backend/rewrite/rowsecurity.c                            | 1 -
 src/backend/utils/adt/formatting.c                           | 1 -
 src/backend/utils/adt/pgstatfuncs.c                          | 5 -----
 .../mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c  | 1 -
 src/backend/utils/mmgr/mcxt.c                                | 1 -
 src/bin/pg_amcheck/pg_amcheck.c                              | 3 ---
 src/bin/psql/command.c                                       | 4 ----
 src/interfaces/libpq/fe-connect.c                            | 1 -
 20 files changed, 29 deletions(-)

diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c
index 78a8bcee6e3..263e35442b3 100644
--- a/contrib/dblink/dblink.c
+++ b/contrib/dblink/dblink.c
@@ -2428,7 +2428,6 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk
 		ereport(ERROR,
 				(errcode(ERRCODE_CARDINALITY_VIOLATION),
 				 errmsg("source criteria matched more than one record")));
-
 	else if (ret == SPI_OK_SELECT && SPI_processed == 1)
 	{
 		SPITupleTable *tuptable = SPI_tuptable;
diff --git a/contrib/spi/refint.c b/contrib/spi/refint.c
index 18062eb1cff..31e95663466 100644
--- a/contrib/spi/refint.c
+++ b/contrib/spi/refint.c
@@ -456,7 +456,6 @@ check_foreign_key(PG_FUNCTION_ARGS)
 			 * updates new key values in referenced tables
 			 */
 
-
 			else if (action == 'c')
 			{
 				if (is_update == 1)
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c
index 69f66dfe7da..bfd44d3b2c6 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -1575,7 +1575,6 @@ CreateCast(CreateCastStmt *stmt)
 		ereport(WARNING,
 				(errcode(ERRCODE_WRONG_OBJECT_TYPE),
 				 errmsg("cast will be ignored because the source data type is a domain")));
-
 	else if (targettyptype == TYPTYPE_DOMAIN)
 		ereport(WARNING,
 				(errcode(ERRCODE_WRONG_OBJECT_TYPE),
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 1293545947e..debbe8a73ef 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -17002,7 +17002,6 @@ RangeVarCallbackForAlterRelation(const RangeVar *rv, Oid relid, Oid oldrelid,
 	}
 	else if (IsA(stmt, AlterObjectSchemaStmt))
 		reltype = ((AlterObjectSchemaStmt *) stmt)->objectType;
-
 	else if (IsA(stmt, AlterTableStmt))
 		reltype = ((AlterTableStmt *) stmt)->objtype;
 	else
diff --git a/src/backend/executor/nodeTidrangescan.c b/src/backend/executor/nodeTidrangescan.c
index 2124c55ef53..5f0c9f06879 100644
--- a/src/backend/executor/nodeTidrangescan.c
+++ b/src/backend/executor/nodeTidrangescan.c
@@ -183,7 +183,6 @@ TidRangeEval(TidRangeScanState *node)
 			if (ItemPointerCompare(&lb, &lowerBound) > 0)
 				ItemPointerCopy(&lb, &lowerBound);
 		}
-
 		else if (tidopexpr->exprtype == TIDEXPR_UPPER_BOUND)
 		{
 			ItemPointerData ub;
diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c
index e3c7c12aa0e..4e721b705d5 100644
--- a/src/backend/libpq/be-secure-openssl.c
+++ b/src/backend/libpq/be-secure-openssl.c
@@ -1630,7 +1630,6 @@ default_openssl_tls_init(SSL_CTX *context, bool isServerStart)
 		if (ssl_passphrase_command[0] && ssl_passphrase_command_supports_reload)
 			SSL_CTX_set_default_passwd_cb(context, ssl_external_passwd_cb);
 		else
-
 			/*
 			 * If reloading and no external command is configured, override
 			 * OpenSSL's default handling of passphrase-protected files,
diff --git a/src/backend/optimizer/geqo/geqo_erx.c b/src/backend/optimizer/geqo/geqo_erx.c
index 21ad7854118..26b58f43dee 100644
--- a/src/backend/optimizer/geqo/geqo_erx.c
+++ b/src/backend/optimizer/geqo/geqo_erx.c
@@ -212,7 +212,6 @@ gimme_tour(PlannerInfo *root, Edge *edge_table, Gene *new_gene, int num_gene)
 
 		if (edge_table[new_gene[i - 1]].unused_edges > 0)
 			new_gene[i] = gimme_gene(root, edge_table[(int) new_gene[i - 1]], edge_table);
-
 		else
 		{						/* cope with fault */
 			edge_failures++;
diff --git a/src/backend/optimizer/geqo/geqo_pmx.c b/src/backend/optimizer/geqo/geqo_pmx.c
index e44fd0bae5a..dd35d269281 100644
--- a/src/backend/optimizer/geqo/geqo_pmx.c
+++ b/src/backend/optimizer/geqo/geqo_pmx.c
@@ -112,7 +112,6 @@ pmx(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring, int num_gene)
 
 		if (tour1[k] == tour2[k])
 			found = 1;			/* find match in tour2 */
-
 		else
 		{
 			found = 0;			/* substitute elements */
diff --git a/src/backend/optimizer/geqo/geqo_pool.c b/src/backend/optimizer/geqo/geqo_pool.c
index e45bd7286b2..584dc020fda 100644
--- a/src/backend/optimizer/geqo/geqo_pool.c
+++ b/src/backend/optimizer/geqo/geqo_pool.c
@@ -218,7 +218,6 @@ spread_chromo(PlannerInfo *root, Chromosome *chromo, Pool *pool)
 		else if (bot - top <= 1)
 			index = bot;
 
-
 		/*
 		 * these 2 cases move the search indices since a new location has not
 		 * yet been found.
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
index 76e25118f94..080180e2d0d 100644
--- a/src/backend/optimizer/util/clauses.c
+++ b/src/backend/optimizer/util/clauses.c
@@ -733,7 +733,6 @@ max_parallel_hazard_walker(Node *node, max_parallel_hazard_context *context)
 		if (max_parallel_hazard_test(PROPARALLEL_RESTRICTED, context))
 			return true;
 	}
-
 	else if (IsA(node, NextValueExpr))
 	{
 		if (max_parallel_hazard_test(PROPARALLEL_UNSAFE, context))
diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c
index 2c04c8707dc..04b084d298e 100644
--- a/src/backend/replication/logical/origin.c
+++ b/src/backend/replication/logical/origin.c
@@ -1133,7 +1133,6 @@ replorigin_session_setup(RepOriginId node, int acquired_by)
 		/* not our slot */
 		if (curstate->roident != node)
 			continue;
-
 		else if (curstate->acquired_by != 0 && acquired_by == 0)
 		{
 			ereport(ERROR,
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index 62542827e4b..e45e0e56756 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -1647,7 +1647,6 @@ SnapBuildSerialize(SnapBuild *builder, XLogRecPtr lsn)
 		ereport(ERROR,
 				(errcode_for_file_access(),
 				 errmsg("could not stat file \"%s\": %m", path)));
-
 	else if (ret == 0)
 	{
 		/*
diff --git a/src/backend/rewrite/rowsecurity.c b/src/backend/rewrite/rowsecurity.c
index 569c1c94679..0666e7ba06a 100644
--- a/src/backend/rewrite/rowsecurity.c
+++ b/src/backend/rewrite/rowsecurity.c
@@ -727,7 +727,6 @@ add_security_quals(int rt_index,
 		*securityQuals = list_append_unique(*securityQuals, rowsec_expr);
 	}
 	else
-
 		/*
 		 * A permissive policy must exist for rows to be visible at all.
 		 * Therefore, if there were no permissive policies found, return a
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index f3f4db5ef60..7ac400ce092 100644
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -5082,7 +5082,6 @@ NUM_prepare_locale(NUMProc *Np)
 		 */
 		if (lconv->decimal_point && *lconv->decimal_point)
 			Np->decimal = lconv->decimal_point;
-
 		else
 			Np->decimal = ".";
 
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c
index 67374934022..1797416427d 100644
--- a/src/backend/utils/adt/pgstatfuncs.c
+++ b/src/backend/utils/adt/pgstatfuncs.c
@@ -814,7 +814,6 @@ pg_stat_get_backend_activity_start(PG_FUNCTION_ARGS)
 
 	if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL)
 		PG_RETURN_NULL();
-
 	else if (!HAS_PGSTAT_PERMISSIONS(beentry->st_userid))
 		PG_RETURN_NULL();
 
@@ -840,7 +839,6 @@ pg_stat_get_backend_xact_start(PG_FUNCTION_ARGS)
 
 	if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL)
 		PG_RETURN_NULL();
-
 	else if (!HAS_PGSTAT_PERMISSIONS(beentry->st_userid))
 		PG_RETURN_NULL();
 
@@ -862,7 +860,6 @@ pg_stat_get_backend_start(PG_FUNCTION_ARGS)
 
 	if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL)
 		PG_RETURN_NULL();
-
 	else if (!HAS_PGSTAT_PERMISSIONS(beentry->st_userid))
 		PG_RETURN_NULL();
 
@@ -886,7 +883,6 @@ pg_stat_get_backend_client_addr(PG_FUNCTION_ARGS)
 
 	if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL)
 		PG_RETURN_NULL();
-
 	else if (!HAS_PGSTAT_PERMISSIONS(beentry->st_userid))
 		PG_RETURN_NULL();
 
@@ -931,7 +927,6 @@ pg_stat_get_backend_client_port(PG_FUNCTION_ARGS)
 
 	if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL)
 		PG_RETURN_NULL();
-
 	else if (!HAS_PGSTAT_PERMISSIONS(beentry->st_userid))
 		PG_RETURN_NULL();
 
diff --git a/src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c b/src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c
index bae24681668..9d344e9a8e4 100644
--- a/src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c
+++ b/src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c
@@ -162,7 +162,6 @@ euc_jis_20042shift_jis_2004(const unsigned char *euc, unsigned char *p, int len,
 			else
 				*p++ = ten + 0x9e;
 		}
-
 		else if (l == 2)		/* JIS X 0213 plane 1? */
 		{
 			ku = c1 - 0xa0;
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c
index 0b00802df70..4646ae50277 100644
--- a/src/backend/utils/mmgr/mcxt.c
+++ b/src/backend/utils/mmgr/mcxt.c
@@ -711,7 +711,6 @@ MemoryContextStatsDetail(MemoryContext context, int max_children,
 				grand_totals.freespace, grand_totals.freechunks,
 				grand_totals.totalspace - grand_totals.freespace);
 	else
-
 		/*
 		 * Use LOG_SERVER_ONLY to prevent the memory contexts from being sent
 		 * to the connected client.
diff --git a/src/bin/pg_amcheck/pg_amcheck.c b/src/bin/pg_amcheck/pg_amcheck.c
index 68f8180c19f..4b770d83a70 100644
--- a/src/bin/pg_amcheck/pg_amcheck.c
+++ b/src/bin/pg_amcheck/pg_amcheck.c
@@ -1017,18 +1017,15 @@ verify_heap_slot_handler(PGresult *res, PGconn *conn, void *context)
 					   PQgetvalue(res, i, 0),	/* blkno */
 					   PQgetvalue(res, i, 1),	/* offnum */
 					   PQgetvalue(res, i, 2));	/* attnum */
-
 			else if (!PQgetisnull(res, i, 1))
 				printf(_("heap table \"%s.%s.%s\", block %s, offset %s:\n"),
 					   rel->datinfo->datname, rel->nspname, rel->relname,
 					   PQgetvalue(res, i, 0),	/* blkno */
 					   PQgetvalue(res, i, 1));	/* offnum */
-
 			else if (!PQgetisnull(res, i, 0))
 				printf(_("heap table \"%s.%s.%s\", block %s:\n"),
 					   rel->datinfo->datname, rel->nspname, rel->relname,
 					   PQgetvalue(res, i, 0));	/* blkno */
-
 			else
 				printf(_("heap table \"%s.%s.%s\":\n"),
 					   rel->datinfo->datname, rel->nspname, rel->relname);
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index b5201edf555..3e0b37a17ca 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -1992,7 +1992,6 @@ exec_command_lo(PsqlScanState scan_state, bool active_branch, const char *cmd)
 				success = do_lo_export(opt1, opt2);
 			}
 		}
-
 		else if (strcmp(cmd + 3, "import") == 0)
 		{
 			if (!opt1)
@@ -2006,12 +2005,10 @@ exec_command_lo(PsqlScanState scan_state, bool active_branch, const char *cmd)
 				success = do_lo_import(opt1, opt2);
 			}
 		}
-
 		else if (strcmp(cmd + 3, "list") == 0)
 			success = listLargeObjects(false);
 		else if (strcmp(cmd + 3, "list+") == 0)
 			success = listLargeObjects(true);
-
 		else if (strcmp(cmd + 3, "unlink") == 0)
 		{
 			if (!opt1)
@@ -2022,7 +2019,6 @@ exec_command_lo(PsqlScanState scan_state, bool active_branch, const char *cmd)
 			else
 				success = do_lo_unlink(opt1);
 		}
-
 		else
 			status = PSQL_CMD_UNKNOWN;
 
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 50b5df3490b..00ba10b01b4 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -7012,7 +7012,6 @@ passwordFromFile(const char *hostname, const char *port, const char *dbname,
 	if (hostname == NULL || hostname[0] == '\0')
 		hostname = DefaultHost;
 	else if (is_unixsock_path(hostname))
-
 		/*
 		 * We should probably use canonicalize_path(), but then we have to
 		 * bring path.c into libpq, and it doesn't seem worth it.
-- 
2.25.1

>From 25547eaf0cd16ffcd49894922c3f478a4b005308 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Fri, 20 Jan 2023 17:39:35 -0600
Subject: [PATCH 06/10] doc typo: pg_used_reserved_connections

v16: 6e2775e4d4e47775f0d933e4a93c148024a3bc63
---
 doc/src/sgml/config.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index d190be1925d..8c56b134a84 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -718,7 +718,7 @@ include_dir 'conf.d'
        <para>
         Determines the number of connection <quote>slots</quote> that are
         reserved for connections by roles with privileges of the
-        <link linkend="predefined-roles-table"><literal>pg_used_reserved_connections</literal></link>
+        <link linkend="predefined-roles-table"><literal>pg_use_reserved_connections</literal></link>
         role.  Whenever the number of free connection slots is greater than
         <xref linkend="guc-superuser-reserved-connections"/> but less than or
         equal to the sum of <varname>superuser_reserved_connections</varname>
-- 
2.25.1

>From 83556cfd8be8c1f0f27cbed3ffd42dfae038ddd3 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Sun, 13 Nov 2022 14:03:27 -0600
Subject: [PATCH 07/10] cirrus/ccache: use G rather than GB suffix..

the former being the documented spelling.
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index f2129787529..10ec7ac406a 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -665,7 +665,7 @@ task:
 
     # Use larger ccache cache, as this task compiles with multiple compilers /
     # flag combinations
-    CCACHE_MAXSIZE: "1GB"
+    CCACHE_MAXSIZE: "1G"
     CCACHE_DIR: "/tmp/ccache_dir"
 
     LINUX_CONFIGURE_FEATURES: *LINUX_CONFIGURE_FEATURES
-- 
2.25.1

>From cc3c1536bd6f6d69d960c2cecc5e32ca814c9a21 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Sun, 26 Sep 2021 11:13:27 -0500
Subject: [PATCH 08/10] comments grammar: extended (and other) stats

See:
202109272104.7t253iw236fb@alvherre.pgsql
070d2e19e40897d857f570f24888fc30727ed9c0
609b0652af00374b89411ea2613fd5bb92bca92c
a4d75c86bf15220df22de0a92c819ecef9db3849
7300a699502fe5432b05fbc75baca534b080bebb
ccaa3569f58796868303629bc2d63ddddb599b38
---
 src/backend/commands/statscmds.c                 | 4 ++--
 src/backend/statistics/README                    | 2 +-
 src/backend/statistics/dependencies.c            | 8 ++++----
 src/backend/statistics/extended_stats.c          | 4 ++--
 src/backend/utils/adt/pgstatfuncs.c              | 4 ++--
 src/backend/utils/adt/ruleutils.c                | 4 ++--
 src/include/statistics/extended_stats_internal.h | 2 +-
 7 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/backend/commands/statscmds.c b/src/backend/commands/statscmds.c
index 26ebd0819d6..2e41745646b 100644
--- a/src/backend/commands/statscmds.c
+++ b/src/backend/commands/statscmds.c
@@ -377,7 +377,7 @@ CreateStatistics(CreateStatsStmt *stmt)
 
 	/*
 	 * If no statistic type was specified, build them all (but only when the
-	 * statistics is defined on more than one column/expression).
+	 * statistics object is defined on more than one column/expression).
 	 */
 	if ((!requested_type) && (numcols >= 2))
 	{
@@ -432,7 +432,7 @@ CreateStatistics(CreateStatsStmt *stmt)
 	 * similar to why we don't bother with extracting columns from
 	 * expressions. It's either expensive or very easy to defeat for
 	 * determined user, and there's no risk if we allow such statistics (the
-	 * statistics is useless, but harmless).
+	 * statistic is useless, but harmless).
 	 */
 	foreach(cell, stxexprs)
 	{
diff --git a/src/backend/statistics/README b/src/backend/statistics/README
index 13a97a35662..b87ca4734b2 100644
--- a/src/backend/statistics/README
+++ b/src/backend/statistics/README
@@ -24,7 +24,7 @@ There are currently several kinds of extended statistics:
 Compatible clause types
 -----------------------
 
-Each type of statistics may be used to estimate some subset of clause types.
+Each type of statistic may be used to estimate some subset of clause types.
 
     (a) functional dependencies - equality clauses (AND), possibly IS NULL
 
diff --git a/src/backend/statistics/dependencies.c b/src/backend/statistics/dependencies.c
index e6e2835345e..a54e038d6a1 100644
--- a/src/backend/statistics/dependencies.c
+++ b/src/backend/statistics/dependencies.c
@@ -846,7 +846,7 @@ dependency_is_compatible_clause(Node *clause, Index relid, AttrNumber *attnum)
 			AttrNumber	clause_attnum;
 
 			/*
-			 * Had we found incompatible clause in the arguments, treat the
+			 * If we found an incompatible clause in the arguments, treat the
 			 * whole clause as incompatible.
 			 */
 			if (!dependency_is_compatible_clause((Node *) lfirst(lc),
@@ -1274,7 +1274,7 @@ dependency_is_compatible_expression(Node *clause, Index relid, List *statlist, N
 			Node	   *or_expr = NULL;
 
 			/*
-			 * Had we found incompatible expression in the arguments, treat
+			 * If we found an incompatible expression in the arguments, treat
 			 * the whole expression as incompatible.
 			 */
 			if (!dependency_is_compatible_expression((Node *) lfirst(lc), relid,
@@ -1725,7 +1725,7 @@ dependencies_clauselist_selectivity(PlannerInfo *root,
 
 					/*
 					 * For expressions, we need to do two translations. First
-					 * we have to translate the negative attnum to index in
+					 * we have to translate the negative attnum to an index in
 					 * the list of expressions (in the statistics object).
 					 * Then we need to see if there's a matching clause. The
 					 * index of the unique expression determines the attnum
@@ -1733,7 +1733,7 @@ dependencies_clauselist_selectivity(PlannerInfo *root,
 					 */
 					idx = -(1 + attnum);
 
-					/* Is the expression index is valid? */
+					/* Is the expression index valid? */
 					Assert((idx >= 0) && (idx < list_length(stat->exprs)));
 
 					expr = (Node *) list_nth(stat->exprs, idx);
diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index 572d9b44643..e18398cd428 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -1214,8 +1214,8 @@ stat_covers_expressions(StatisticExtInfo *stat, List *exprs,
 
 /*
  * choose_best_statistics
- *		Look for and return statistics with the specified 'requiredkind' which
- *		have keys that match at least two of the given attnums.  Return NULL if
+ *		Look for and return the statistics object with the specified 'requiredkind' which
+ *		has keys that match at least two of the given attnums.  Return NULL if
  *		there's no match.
  *
  * The current selection criteria is very simple - we choose the statistics
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c
index 1797416427d..268ff16f99c 100644
--- a/src/backend/utils/adt/pgstatfuncs.c
+++ b/src/backend/utils/adt/pgstatfuncs.c
@@ -1755,7 +1755,7 @@ pg_stat_get_archiver(PG_FUNCTION_ARGS)
 }
 
 /*
- * Get the statistics for the replication slot. If the slot statistics is not
+ * Get the statistics for the replication slot. If the slot statistics are not
  * available, return all-zeroes stats.
  */
 Datum
@@ -1827,7 +1827,7 @@ pg_stat_get_replication_slot(PG_FUNCTION_ARGS)
 
 /*
  * Get the subscription statistics for the given subscription. If the
- * subscription statistics is not available, return all-zeros stats.
+ * subscription statistics are not available, return all-zeros stats.
  */
 Datum
 pg_stat_get_subscription_stats(PG_FUNCTION_ARGS)
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 9ac42efdbc3..075c4d0ad86 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -1699,8 +1699,8 @@ pg_get_statisticsobj_worker(Oid statextid, bool columns_only, bool missing_ok)
 		 * will create all statistics types on a newer postgres version, if
 		 * the statistics had all options enabled on the original version.
 		 *
-		 * But if the statistics is defined on just a single column, it has to
-		 * be an expression statistics. In that case we don't need to specify
+		 * But if the statistics are defined on just a single column, it has to
+		 * be a statistics expression. In that case we don't need to specify
 		 * kinds.
 		 */
 		if ((!ndistinct_enabled || !dependencies_enabled || !mcv_enabled) &&
diff --git a/src/include/statistics/extended_stats_internal.h b/src/include/statistics/extended_stats_internal.h
index 7b55eb8ffac..72f94814704 100644
--- a/src/include/statistics/extended_stats_internal.h
+++ b/src/include/statistics/extended_stats_internal.h
@@ -57,7 +57,7 @@ typedef struct SortItem
 	int			count;
 } SortItem;
 
-/* a unified representation of the data the statistics is built on */
+/* a unified representation of the data the statistics object is built on */
 typedef struct StatsBuildData
 {
 	int			numrows;
-- 
2.25.1

>From f2e68b7c2f5dd727815fbe24390996324d692d43 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Sat, 23 Jul 2022 15:10:01 -0500
Subject: [PATCH 09/10] fix whitespace

weird since c91560defc57f89f7e88632ea14ae77b5cec78ee

See also:
https://www.postgresql.org/message-id/cafbsxshtyve1txm+nym5gb1c3ezn_qdpjoosjk_vsc2dxqz...@mail.gmail.com
---
 src/backend/commands/indexcmds.c            |   2 +-
 src/backend/utils/activity/backend_status.c |   2 +-
 src/backend/utils/cache/inval.c             | 188 ++++++++++----------
 src/backend/utils/mmgr/mcxt.c               |   4 +-
 4 files changed, 98 insertions(+), 98 deletions(-)

diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 16ec0b114e6..38e6d9ebe7e 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -2313,7 +2313,7 @@ GetDefaultOpClass(Oid type_id, Oid am_id)
  *	extended statistics, etc.
  *
  *	The parameters are typically: the original table name, the original field
- *	name, and a "type" string (such as "seq" or "pkey").    The field name
+ *	name, and a "type" string (such as "seq" or "pkey").  The field name
  *	and/or type can be NULL if not relevant.
  *
  *	The result is a palloc'd string.
diff --git a/src/backend/utils/activity/backend_status.c b/src/backend/utils/activity/backend_status.c
index 608d01ea0dd..f6e847ff3b6 100644
--- a/src/backend/utils/activity/backend_status.c
+++ b/src/backend/utils/activity/backend_status.c
@@ -786,7 +786,7 @@ pgstat_read_current_status(void)
 		 * Follow the protocol of retrying if st_changecount changes while we
 		 * copy the entry, or if it's odd.  (The check for odd is needed to
 		 * cover the case where we are able to completely copy the entry while
-		 * the source backend is between increment steps.)	We use a volatile
+		 * the source backend is between increment steps.)  We use a volatile
 		 * pointer here to ensure the compiler doesn't try to get cute.
 		 */
 		for (;;)
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index 0008826f67c..cc7de542b1e 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -3,100 +3,100 @@
  * inval.c
  *	  POSTGRES cache invalidation dispatcher code.
  *
- *	This is subtle stuff, so pay attention:
- *
- *	When a tuple is updated or deleted, our standard visibility rules
- *	consider that it is *still valid* so long as we are in the same command,
- *	ie, until the next CommandCounterIncrement() or transaction commit.
- *	(See access/heap/heapam_visibility.c, and note that system catalogs are
- *  generally scanned under the most current snapshot available, rather than
- *  the transaction snapshot.)	At the command boundary, the old tuple stops
- *	being valid and the new version, if any, becomes valid.  Therefore,
- *	we cannot simply flush a tuple from the system caches during heap_update()
- *	or heap_delete().  The tuple is still good at that point; what's more,
- *	even if we did flush it, it might be reloaded into the caches by a later
- *	request in the same command.  So the correct behavior is to keep a list
- *	of outdated (updated/deleted) tuples and then do the required cache
- *	flushes at the next command boundary.  We must also keep track of
- *	inserted tuples so that we can flush "negative" cache entries that match
- *	the new tuples; again, that mustn't happen until end of command.
- *
- *	Once we have finished the command, we still need to remember inserted
- *	tuples (including new versions of updated tuples), so that we can flush
- *	them from the caches if we abort the transaction.  Similarly, we'd better
- *	be able to flush "negative" cache entries that may have been loaded in
- *	place of deleted tuples, so we still need the deleted ones too.
- *
- *	If we successfully complete the transaction, we have to broadcast all
- *	these invalidation events to other backends (via the SI message queue)
- *	so that they can flush obsolete entries from their caches.  Note we have
- *	to record the transaction commit before sending SI messages, otherwise
- *	the other backends won't see our updated tuples as good.
- *
- *	When a subtransaction aborts, we can process and discard any events
- *	it has queued.  When a subtransaction commits, we just add its events
- *	to the pending lists of the parent transaction.
- *
- *	In short, we need to remember until xact end every insert or delete
- *	of a tuple that might be in the system caches.  Updates are treated as
- *	two events, delete + insert, for simplicity.  (If the update doesn't
- *	change the tuple hash value, catcache.c optimizes this into one event.)
- *
- *	We do not need to register EVERY tuple operation in this way, just those
- *	on tuples in relations that have associated catcaches.  We do, however,
- *	have to register every operation on every tuple that *could* be in a
- *	catcache, whether or not it currently is in our cache.  Also, if the
- *	tuple is in a relation that has multiple catcaches, we need to register
- *	an invalidation message for each such catcache.  catcache.c's
- *	PrepareToInvalidateCacheTuple() routine provides the knowledge of which
- *	catcaches may need invalidation for a given tuple.
- *
- *	Also, whenever we see an operation on a pg_class, pg_attribute, or
- *	pg_index tuple, we register a relcache flush operation for the relation
- *	described by that tuple (as specified in CacheInvalidateHeapTuple()).
- *	Likewise for pg_constraint tuples for foreign keys on relations.
- *
- *	We keep the relcache flush requests in lists separate from the catcache
- *	tuple flush requests.  This allows us to issue all the pending catcache
- *	flushes before we issue relcache flushes, which saves us from loading
- *	a catcache tuple during relcache load only to flush it again right away.
- *	Also, we avoid queuing multiple relcache flush requests for the same
- *	relation, since a relcache flush is relatively expensive to do.
- *	(XXX is it worth testing likewise for duplicate catcache flush entries?
- *	Probably not.)
- *
- *	Many subsystems own higher-level caches that depend on relcache and/or
- *	catcache, and they register callbacks here to invalidate their caches.
- *	While building a higher-level cache entry, a backend may receive a
- *	callback for the being-built entry or one of its dependencies.  This
- *	implies the new higher-level entry would be born stale, and it might
- *	remain stale for the life of the backend.  Many caches do not prevent
- *	that.  They rely on DDL for can't-miss catalog changes taking
- *	AccessExclusiveLock on suitable objects.  (For a change made with less
- *	locking, backends might never read the change.)  The relation cache,
- *	however, needs to reflect changes from CREATE INDEX CONCURRENTLY no later
- *	than the beginning of the next transaction.  Hence, when a relevant
- *	invalidation callback arrives during a build, relcache.c reattempts that
- *	build.  Caches with similar needs could do likewise.
- *
- *	If a relcache flush is issued for a system relation that we preload
- *	from the relcache init file, we must also delete the init file so that
- *	it will be rebuilt during the next backend restart.  The actual work of
- *	manipulating the init file is in relcache.c, but we keep track of the
- *	need for it here.
- *
- *	Currently, inval messages are sent without regard for the possibility
- *	that the object described by the catalog tuple might be a session-local
- *	object such as a temporary table.  This is because (1) this code has
- *	no practical way to tell the difference, and (2) it is not certain that
- *	other backends don't have catalog cache or even relcache entries for
- *	such tables, anyway; there is nothing that prevents that.  It might be
- *	worth trying to avoid sending such inval traffic in the future, if those
- *	problems can be overcome cheaply.
- *
- *	When wal_level=logical, write invalidations into WAL at each command end to
- *	support the decoding of the in-progress transactions.  See
- *	CommandEndInvalidationMessages.
+ * This is subtle stuff, so pay attention:
+ *
+ * When a tuple is updated or deleted, our standard visibility rules
+ * consider that it is *still valid* so long as we are in the same command,
+ * ie, until the next CommandCounterIncrement() or transaction commit.
+ * (See access/heap/heapam_visibility.c, and note that system catalogs are
+ * generally scanned under the most current snapshot available, rather than
+ * the transaction snapshot.)  At the command boundary, the old tuple stops
+ * being valid and the new version, if any, becomes valid.  Therefore,
+ * we cannot simply flush a tuple from the system caches during heap_update()
+ * or heap_delete().  The tuple is still good at that point; what's more,
+ * even if we did flush it, it might be reloaded into the caches by a later
+ * request in the same command.  So the correct behavior is to keep a list
+ * of outdated (updated/deleted) tuples and then do the required cache
+ * flushes at the next command boundary.  We must also keep track of
+ * inserted tuples so that we can flush "negative" cache entries that match
+ * the new tuples; again, that mustn't happen until end of command.
+ *
+ * Once we have finished the command, we still need to remember inserted
+ * tuples (including new versions of updated tuples), so that we can flush
+ * them from the caches if we abort the transaction.  Similarly, we'd better
+ * be able to flush "negative" cache entries that may have been loaded in
+ * place of deleted tuples, so we still need the deleted ones too.
+ *
+ * If we successfully complete the transaction, we have to broadcast all
+ * these invalidation events to other backends (via the SI message queue)
+ * so that they can flush obsolete entries from their caches.  Note we have
+ * to record the transaction commit before sending SI messages, otherwise
+ * the other backends won't see our updated tuples as good.
+ *
+ * When a subtransaction aborts, we can process and discard any events
+ * it has queued.  When a subtransaction commits, we just add its events
+ * to the pending lists of the parent transaction.
+ *
+ * In short, we need to remember until xact end every insert or delete
+ * of a tuple that might be in the system caches.  Updates are treated as
+ * two events, delete + insert, for simplicity.  (If the update doesn't
+ * change the tuple hash value, catcache.c optimizes this into one event.)
+ *
+ * We do not need to register EVERY tuple operation in this way, just those
+ * on tuples in relations that have associated catcaches.  We do, however,
+ * have to register every operation on every tuple that *could* be in a
+ * catcache, whether or not it currently is in our cache.  Also, if the
+ * tuple is in a relation that has multiple catcaches, we need to register
+ * an invalidation message for each such catcache.  catcache.c's
+ * PrepareToInvalidateCacheTuple() routine provides the knowledge of which
+ * catcaches may need invalidation for a given tuple.
+ *
+ * Also, whenever we see an operation on a pg_class, pg_attribute, or
+ * pg_index tuple, we register a relcache flush operation for the relation
+ * described by that tuple (as specified in CacheInvalidateHeapTuple()).
+ * Likewise for pg_constraint tuples for foreign keys on relations.
+ *
+ * We keep the relcache flush requests in lists separate from the catcache
+ * tuple flush requests.  This allows us to issue all the pending catcache
+ * flushes before we issue relcache flushes, which saves us from loading
+ * a catcache tuple during relcache load only to flush it again right away.
+ * Also, we avoid queuing multiple relcache flush requests for the same
+ * relation, since a relcache flush is relatively expensive to do.
+ * (XXX is it worth testing likewise for duplicate catcache flush entries?
+ * Probably not.)
+ *
+ * Many subsystems own higher-level caches that depend on relcache and/or
+ * catcache, and they register callbacks here to invalidate their caches.
+ * While building a higher-level cache entry, a backend may receive a
+ * callback for the being-built entry or one of its dependencies.  This
+ * implies the new higher-level entry would be born stale, and it might
+ * remain stale for the life of the backend.  Many caches do not prevent
+ * that.  They rely on DDL for can't-miss catalog changes taking
+ * AccessExclusiveLock on suitable objects.  (For a change made with less
+ * locking, backends might never read the change.)  The relation cache,
+ * however, needs to reflect changes from CREATE INDEX CONCURRENTLY no later
+ * than the beginning of the next transaction.  Hence, when a relevant
+ * invalidation callback arrives during a build, relcache.c reattempts that
+ * build.  Caches with similar needs could do likewise.
+ *
+ * If a relcache flush is issued for a system relation that we preload
+ * from the relcache init file, we must also delete the init file so that
+ * it will be rebuilt during the next backend restart.  The actual work of
+ * manipulating the init file is in relcache.c, but we keep track of the
+ * need for it here.
+ *
+ * Currently, inval messages are sent without regard for the possibility
+ * that the object described by the catalog tuple might be a session-local
+ * object such as a temporary table.  This is because (1) this code has
+ * no practical way to tell the difference, and (2) it is not certain that
+ * other backends don't have catalog cache or even relcache entries for
+ * such tables, anyway; there is nothing that prevents that.  It might be
+ * worth trying to avoid sending such inval traffic in the future, if those
+ * problems can be overcome cheaply.
+ *
+ * When wal_level=logical, write invalidations into WAL at each command end to
+ * support the decoding of the in-progress transactions.  See
+ * CommandEndInvalidationMessages.
  *
  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c
index 4646ae50277..bdaa9539e40 100644
--- a/src/backend/utils/mmgr/mcxt.c
+++ b/src/backend/utils/mmgr/mcxt.c
@@ -928,7 +928,7 @@ MemoryContextCheck(MemoryContext context)
  * context creation routines, not by the unwashed masses.
  *
  * The memory context creation procedure goes like this:
- *	1.  Context-type-specific routine makes some initial space allocation,
+ *	1.	Context-type-specific routine makes some initial space allocation,
  *		including enough space for the context header.  If it fails,
  *		it can ereport() with no damage done.
  *	2.	Context-type-specific routine sets up all type-specific fields of
@@ -938,7 +938,7 @@ MemoryContextCheck(MemoryContext context)
  *		the initial space allocation should be freed before ereport'ing.
  *	3.	Context-type-specific routine calls MemoryContextCreate() to fill in
  *		the generic header fields and link the context into the context tree.
- *	4.  We return to the context-type-specific routine, which finishes
+ *	4.	We return to the context-type-specific routine, which finishes
  *		up type-specific initialization.  This routine can now do things
  *		that might fail (like allocate more memory), so long as it's
  *		sure the node is left in a state that delete will handle.
-- 
2.25.1

>From 9a38d4fbf2a3b441505c169533f1b96726c8b03b Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Tue, 31 Jan 2023 13:32:59 -0600
Subject: [PATCH 10/10] WIP: whitespace issues

TODO:
git grep '\*.*\w.*        \w' '*.c'
git grep '\*.* .* .*\w.*        \w' '*.c'
---
 contrib/pg_trgm/trgm_regexp.c              | 2 +-
 src/backend/access/common/tupconvert.c     | 2 +-
 src/backend/access/gin/ginfast.c           | 2 +-
 src/backend/access/heap/heapam.c           | 2 +-
 src/backend/access/heap/hio.c              | 2 +-
 src/backend/access/nbtree/nbtutils.c       | 2 +-
 src/backend/access/transam/clog.c          | 2 +-
 src/backend/access/transam/multixact.c     | 2 +-
 src/backend/access/transam/xlog.c          | 2 +-
 src/backend/catalog/aclchk.c               | 2 +-
 src/backend/catalog/namespace.c            | 6 +++---
 src/backend/catalog/pg_proc.c              | 2 +-
 src/backend/catalog/pg_shdepend.c          | 4 ++--
 src/backend/commands/analyze.c             | 2 +-
 src/backend/commands/dbcommands.c          | 2 +-
 src/backend/commands/opclasscmds.c         | 4 ++--
 src/backend/commands/vacuum.c              | 2 +-
 src/backend/executor/execAmi.c             | 2 +-
 src/backend/executor/execExpr.c            | 2 +-
 src/backend/executor/functions.c           | 2 +-
 src/backend/executor/nodeAgg.c             | 2 +-
 src/backend/executor/nodeGather.c          | 2 +-
 src/backend/executor/nodeGatherMerge.c     | 2 +-
 src/backend/executor/nodeIncrementalSort.c | 2 +-
 src/backend/lib/rbtree.c                   | 2 +-
 src/backend/libpq/be-secure-openssl.c      | 2 +-
 src/backend/optimizer/path/clausesel.c     | 2 +-
 src/backend/optimizer/path/costsize.c      | 6 +++---
 src/backend/optimizer/path/joinpath.c      | 2 +-
 src/backend/optimizer/path/pathkeys.c      | 2 +-
 src/backend/optimizer/plan/createplan.c    | 4 ++--
 src/backend/optimizer/plan/initsplan.c     | 2 +-
 src/backend/optimizer/prep/prepjointree.c  | 2 +-
 src/backend/optimizer/util/orclauses.c     | 2 +-
 src/backend/optimizer/util/pathnode.c      | 2 +-
 src/backend/optimizer/util/var.c           | 2 +-
 src/backend/parser/parse_coerce.c          | 2 +-
 src/backend/postmaster/postmaster.c        | 2 +-
 src/backend/statistics/extended_stats.c    | 2 +-
 src/backend/storage/file/fd.c              | 2 +-
 src/backend/storage/lmgr/lock.c            | 4 ++--
 src/backend/storage/smgr/smgr.c            | 2 +-
 src/backend/tcop/postgres.c                | 2 +-
 src/backend/tsearch/ts_parse.c             | 2 +-
 src/backend/utils/adt/acl.c                | 2 +-
 src/backend/utils/adt/like_support.c       | 2 +-
 src/backend/utils/adt/selfuncs.c           | 4 ++--
 src/backend/utils/adt/varlena.c            | 6 +++---
 src/backend/utils/cache/plancache.c        | 2 +-
 src/backend/utils/cache/relcache.c         | 2 +-
 src/backend/utils/cache/ts_cache.c         | 2 +-
 src/backend/utils/misc/guc.c               | 2 +-
 src/backend/utils/mmgr/dsa.c               | 2 +-
 src/bin/initdb/initdb.c                    | 2 +-
 src/bin/pg_dump/dumputils.c                | 2 +-
 src/bin/pg_dump/pg_dump.c                  | 2 +-
 src/bin/pg_test_timing/pg_test_timing.c    | 2 +-
 src/bin/pg_upgrade/server.c                | 2 +-
 src/interfaces/ecpg/ecpglib/prepare.c      | 2 +-
 src/interfaces/ecpg/pgtypeslib/timestamp.c | 2 +-
 60 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/contrib/pg_trgm/trgm_regexp.c b/contrib/pg_trgm/trgm_regexp.c
index 9a00564ae4f..5f41ff1e5d1 100644
--- a/contrib/pg_trgm/trgm_regexp.c
+++ b/contrib/pg_trgm/trgm_regexp.c
@@ -1608,7 +1608,7 @@ selectColorTrigrams(TrgmNFA *trgmNFA)
 
 		/*
 		 * Does any arc of this color trigram connect initial and final
-		 * states?	If so we can't remove it.
+		 * states?  If so we can't remove it.
 		 */
 		foreach(cell, trgmInfo->arcs)
 		{
diff --git a/src/backend/access/common/tupconvert.c b/src/backend/access/common/tupconvert.c
index d303fe010a2..128d407e24a 100644
--- a/src/backend/access/common/tupconvert.c
+++ b/src/backend/access/common/tupconvert.c
@@ -93,7 +93,7 @@ convert_tuples_by_position(TupleDesc indesc,
 
 /*
  * Set up for tuple conversion, matching input and output columns by name.
- * (Dropped columns are ignored in both input and output.)	This is intended
+ * (Dropped columns are ignored in both input and output.)  This is intended
  * for use when the rowtypes are related by inheritance, so we expect an exact
  * match of both type and typmod.  The error messages will be a bit unhelpful
  * unless both rowtypes are named composite types.
diff --git a/src/backend/access/gin/ginfast.c b/src/backend/access/gin/ginfast.c
index ca7d770d864..ec3bd4f4baf 100644
--- a/src/backend/access/gin/ginfast.c
+++ b/src/backend/access/gin/ginfast.c
@@ -889,7 +889,7 @@ ginInsertCleanup(GinState *ginstate, bool full_clean,
 		vacuum_delay_point();
 
 		/*
-		 * Is it time to flush memory to disk?	Flush if we are at the end of
+		 * Is it time to flush memory to disk?  Flush if we are at the end of
 		 * the pending list, or if we have a full row and memory is getting
 		 * full.
 		 */
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 7eb79cee58d..1e752972a4d 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -3915,7 +3915,7 @@ HeapDetermineColumnsInfo(Relation relation,
 		/*
 		 * Extract the corresponding values.  XXX this is pretty inefficient
 		 * if there are many indexed columns.  Should we do a single
-		 * heap_deform_tuple call on each tuple, instead?	But that doesn't
+		 * heap_deform_tuple call on each tuple, instead?  But that doesn't
 		 * work for system columns ...
 		 */
 		value1 = heap_getattr(oldtup, attrnum, tupdesc, &isnull1);
diff --git a/src/backend/access/heap/hio.c b/src/backend/access/heap/hio.c
index e152807d2dc..4d38667fcee 100644
--- a/src/backend/access/heap/hio.c
+++ b/src/backend/access/heap/hio.c
@@ -716,7 +716,7 @@ loop:
 	 *
 	 * XXX should we enter the new page into the free space map immediately,
 	 * or just keep it for this backend's exclusive use in the short run
-	 * (until VACUUM sees it)?	Seems to depend on whether you expect the
+	 * (until VACUUM sees it)?  Seems to depend on whether you expect the
 	 * current backend to make more insertions or not, which is probably a
 	 * good bet most of the time.  So for now, don't add it to FSM yet.
 	 */
diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c
index 7da499c4dd5..634735b7306 100644
--- a/src/backend/access/nbtree/nbtutils.c
+++ b/src/backend/access/nbtree/nbtutils.c
@@ -1713,7 +1713,7 @@ _bt_check_rowcompare(ScanKey skey, IndexTuple tuple, int tupnatts,
  * any items from the page, and so there is no need to search left from the
  * recorded offset.  (This observation also guarantees that the item is still
  * the right one to delete, which might otherwise be questionable since heap
- * TIDs can get recycled.)	This holds true even if the page has been modified
+ * TIDs can get recycled.)  This holds true even if the page has been modified
  * by inserts and page splits, so there is no need to consult the LSN.
  *
  * If the pin was released after reading the page, then we re-read it.  If it
diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c
index 4a431d58767..d6dc5739a4f 100644
--- a/src/backend/access/transam/clog.c
+++ b/src/backend/access/transam/clog.c
@@ -626,7 +626,7 @@ TransactionIdSetStatusBit(TransactionId xid, XidStatus status, XLogRecPtr lsn, i
  * an LSN that is late enough to be able to guarantee that if we flush up to
  * that LSN then we will have flushed the transaction's commit record to disk.
  * The result is not necessarily the exact LSN of the transaction's commit
- * record!	For example, for long-past transactions (those whose clog pages
+ * record!  For example, for long-past transactions (those whose clog pages
  * already migrated to disk), we'll return InvalidXLogRecPtr.  Also, because
  * we group transactions on the same clog page to conserve storage, we might
  * return the LSN of a later transaction that falls into the same group.
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index fe6698d5ffa..1d9fec7c3e7 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -2668,7 +2668,7 @@ SetOffsetVacuumLimit(bool is_startup)
 	LWLockRelease(MultiXactGenLock);
 
 	/*
-	 * Do we need an emergency autovacuum?	If we're not sure, assume yes.
+	 * Do we need an emergency autovacuum?  If we're not sure, assume yes.
 	 */
 	return !oldestOffsetKnown ||
 		(nextOffset - oldestOffset > MULTIXACT_MEMBER_SAFE_THRESHOLD);
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index f9f0f6db8d1..231276e189d 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -2658,7 +2658,7 @@ XLogFlush(XLogRecPtr record)
 	 * the whole system due to corruption on one data page.  In particular, if
 	 * the bad page is encountered again during recovery then we would be
 	 * unable to restart the database at all!  (This scenario actually
-	 * happened in the field several times with 7.1 releases.)	As of 8.4, bad
+	 * happened in the field several times with 7.1 releases.)  As of 8.4, bad
 	 * LSNs encountered during recovery are UpdateMinRecoveryPoint's problem;
 	 * the only time we can reach here during recovery is while flushing the
 	 * end-of-recovery checkpoint record, and we don't expect that to have a
diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c
index c4232344aab..ff990020e52 100644
--- a/src/backend/catalog/aclchk.c
+++ b/src/backend/catalog/aclchk.c
@@ -4056,7 +4056,7 @@ object_ownercheck(Oid classid, Oid objectid, Oid roleid)
  * Note: roles do not have owners per se; instead we use this test in
  * places where an ownership-like permissions test is needed for a role.
  * Be sure to apply it to the role trying to do the operation, not the
- * role being operated on!	Also note that this generally should not be
+ * role being operated on!  Also note that this generally should not be
  * considered enough privilege if the target role is a superuser.
  * (We don't handle that consideration here because we want to give a
  * separate error message for such cases, so the caller has to deal with it.)
diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c
index 14e57adee2b..dee850d8bdf 100644
--- a/src/backend/catalog/namespace.c
+++ b/src/backend/catalog/namespace.c
@@ -88,7 +88,7 @@
  *
  * The textual specification of search_path can include "$user" to refer to
  * the namespace named the same as the current user, if any.  (This is just
- * ignored if there is no such namespace.)	Also, it can include "pg_temp"
+ * ignored if there is no such namespace.)  Also, it can include "pg_temp"
  * to refer to the current backend's temp namespace.  This is usually also
  * ignorable if the temp namespace hasn't been set up, but there's a special
  * case: if "pg_temp" appears first then it should be the default creation
@@ -1710,7 +1710,7 @@ OpernameGetCandidates(List *names, char oprkind, bool missing_schema_ok)
 
 			/*
 			 * Okay, it's in the search path, but does it have the same
-			 * arguments as something we already accepted?	If so, keep only
+			 * arguments as something we already accepted?  If so, keep only
 			 * the one that appears earlier in the search path.
 			 *
 			 * If we have an ordered list from SearchSysCacheList (the normal
@@ -3813,7 +3813,7 @@ recomputeNamespacePath(void)
 	 * Convert the list of names to a list of OIDs.  If any names are not
 	 * recognizable or we don't have read access, just leave them out of the
 	 * list.  (We can't raise an error, since the search_path setting has
-	 * already been accepted.)	Don't make duplicate entries, either.
+	 * already been accepted.)  Don't make duplicate entries, either.
 	 */
 	oidlist = NIL;
 	temp_missing = false;
diff --git a/src/backend/catalog/pg_proc.c b/src/backend/catalog/pg_proc.c
index 14d552fe2dd..380a948bc58 100644
--- a/src/backend/catalog/pg_proc.c
+++ b/src/backend/catalog/pg_proc.c
@@ -687,7 +687,7 @@ ProcedureCreate(const char *procedureName,
 		 * check_function_bodies is off, we don't do this, because that would
 		 * create dump ordering hazards that pg_dump doesn't know how to deal
 		 * with.  (For example, a SET clause might refer to a not-yet-created
-		 * text search configuration.)	This means that the validator
+		 * text search configuration.)  This means that the validator
 		 * shouldn't complain about anything that might depend on a GUC
 		 * parameter when check_function_bodies is off.
 		 */
diff --git a/src/backend/catalog/pg_shdepend.c b/src/backend/catalog/pg_shdepend.c
index 64d326f073c..fe1868d3b3c 100644
--- a/src/backend/catalog/pg_shdepend.c
+++ b/src/backend/catalog/pg_shdepend.c
@@ -186,7 +186,7 @@ recordDependencyOnOwner(Oid classId, Oid objectId, Oid owner)
  * an object's owner.
  *
  * There must be no more than one existing entry for the given dependent
- * object and dependency type!	So in practice this can only be used for
+ * object and dependency type!  So in practice this can only be used for
  * updating SHARED_DEPENDENCY_OWNER and SHARED_DEPENDENCY_TABLESPACE
  * entries, which should have that property.
  *
@@ -476,7 +476,7 @@ getOidListDiff(Oid *list1, int *nlist1, Oid *list2, int *nlist2)
  *
  * NOTE: Both input arrays must be sorted and de-duped.  (Typically they
  * are extracted from an ACL array by aclmembers(), which takes care of
- * both requirements.)	The arrays are pfreed before return.
+ * both requirements.)  The arrays are pfreed before return.
  */
 void
 updateAclDependencies(Oid classId, Oid objectId, int32 objsubId,
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index 65750958bb2..02d3676011e 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -1026,7 +1026,7 @@ examine_attribute(Relation onerel, int attnum, Node *index_expr)
 	 * type of the opclass, which is not interesting for our purposes.  (Note:
 	 * if we did anything with non-expression index columns, we'd need to
 	 * figure out where to get the correct type info from, but for now that's
-	 * not a problem.)	It's not clear whether anyone will care about the
+	 * not a problem.)  It's not clear whether anyone will care about the
 	 * typmod, but we store that too just in case.
 	 */
 	if (index_expr)
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index ef05633bb05..dccb86597d6 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -2083,7 +2083,7 @@ movedb(const char *dbname, const char *tblspcname)
 	 *
 	 * (This is OK because we know we aren't inside a transaction block.)
 	 *
-	 * XXX would it be safe/better to do this inside the ensure block?	Not
+	 * XXX would it be safe/better to do this inside the ensure block?  Not
 	 * convinced it's a good idea; consider elog just after the transaction
 	 * really commits.
 	 */
diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c
index 864e35e45b4..a4cc0354baf 100644
--- a/src/backend/commands/opclasscmds.c
+++ b/src/backend/commands/opclasscmds.c
@@ -1702,7 +1702,7 @@ dropProcedures(List *opfamilyname, Oid amoid, Oid opfamilyoid,
  * Subroutine for ALTER OPERATOR CLASS SET SCHEMA/RENAME
  *
  * Is there an operator class with the given name and signature already
- * in the given namespace?	If so, raise an appropriate error message.
+ * in the given namespace?  If so, raise an appropriate error message.
  */
 void
 IsThereOpClassInNamespace(const char *opcname, Oid opcmethod,
@@ -1725,7 +1725,7 @@ IsThereOpClassInNamespace(const char *opcname, Oid opcmethod,
  * Subroutine for ALTER OPERATOR FAMILY SET SCHEMA/RENAME
  *
  * Is there an operator family with the given name and signature already
- * in the given namespace?	If so, raise an appropriate error message.
+ * in the given namespace?  If so, raise an appropriate error message.
  */
 void
 IsThereOpFamilyInNamespace(const char *opfname, Oid opfmethod,
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index aa79d9de4d4..bf9466101a7 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -319,7 +319,7 @@ vacuum(List *relations, VacuumParams *params,
 	/*
 	 * We cannot run VACUUM inside a user transaction block; if we were inside
 	 * a transaction, then our commit- and start-transaction-command calls
-	 * would not have the intended effect!	There are numerous other subtle
+	 * would not have the intended effect!  There are numerous other subtle
 	 * dependencies on this, too.
 	 *
 	 * ANALYZE (without VACUUM) can run either way.
diff --git a/src/backend/executor/execAmi.c b/src/backend/executor/execAmi.c
index 9d18ce8c6b2..084b91f6617 100644
--- a/src/backend/executor/execAmi.c
+++ b/src/backend/executor/execAmi.c
@@ -370,7 +370,7 @@ ExecMarkPos(PlanState *node)
  * the mark operation.  It is unspecified what happens to the plan node's
  * result TupleTableSlot.  (In most cases the result slot is unchanged by
  * a restore, but the node may choose to clear it or to load it with the
- * restored-to tuple.)	Hence the caller should discard any previously
+ * restored-to tuple.)  Hence the caller should discard any previously
  * returned TupleTableSlot after doing a restore.
  */
 void
diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c
index 812ead95bc6..797b4fa67c1 100644
--- a/src/backend/executor/execExpr.c
+++ b/src/backend/executor/execExpr.c
@@ -1946,7 +1946,7 @@ ExecInitExprRec(Expr *node, ExprState *state,
 						/*
 						 * Guard against ALTER COLUMN TYPE on rowtype since
 						 * the RowExpr was created.  XXX should we check
-						 * typmod too?	Not sure we can be sure it'll be the
+						 * typmod too?  Not sure we can be sure it'll be the
 						 * same.
 						 */
 						if (exprType((Node *) e) != att->atttypid)
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c
index 50e06ec6931..662c4a7d7ba 100644
--- a/src/backend/executor/functions.c
+++ b/src/backend/executor/functions.c
@@ -1668,7 +1668,7 @@ check_sql_fn_retval(List *queryTreeLists,
 	 * Otherwise, if it's INSERT/UPDATE/DELETE with RETURNING, it returns
 	 * that. Otherwise, the function return type must be VOID.
 	 *
-	 * Note: eventually replace this test with QueryReturnsTuples?	We'd need
+	 * Note: eventually replace this test with QueryReturnsTuples?  We'd need
 	 * a more general method of determining the output type, though.  Also, it
 	 * seems too dangerous to consider FETCH or EXECUTE as returning a
 	 * determinable rowtype, since they depend on relatively short-lived
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 20d23696a53..004724741fd 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -34,7 +34,7 @@
  *	  input tuples and eliminate duplicates (if required) before performing
  *	  the above-depicted process.  (However, we don't do that for ordered-set
  *	  aggregates; their "ORDER BY" inputs are ordinary aggregate arguments
- *	  so far as this module is concerned.)	Note that partial aggregation
+ *	  so far as this module is concerned.)  Note that partial aggregation
  *	  is not supported in these cases, since we couldn't ensure global
  *	  ordering or distinctness of the inputs.
  *
diff --git a/src/backend/executor/nodeGather.c b/src/backend/executor/nodeGather.c
index 307fc10eea7..2c0530426a5 100644
--- a/src/backend/executor/nodeGather.c
+++ b/src/backend/executor/nodeGather.c
@@ -200,7 +200,7 @@ ExecGather(PlanState *pstate)
 			}
 			else
 			{
-				/* No workers?	Then never mind. */
+				/* No workers?  Then never mind. */
 				node->nreaders = 0;
 				node->reader = NULL;
 			}
diff --git a/src/backend/executor/nodeGatherMerge.c b/src/backend/executor/nodeGatherMerge.c
index 9d5e1a46e9e..71052bf08e6 100644
--- a/src/backend/executor/nodeGatherMerge.c
+++ b/src/backend/executor/nodeGatherMerge.c
@@ -241,7 +241,7 @@ ExecGatherMerge(PlanState *pstate)
 			}
 			else
 			{
-				/* No workers?	Then never mind. */
+				/* No workers?  Then never mind. */
 				node->nreaders = 0;
 				node->reader = NULL;
 			}
diff --git a/src/backend/executor/nodeIncrementalSort.c b/src/backend/executor/nodeIncrementalSort.c
index 12bc22f33c6..26ceafec5f8 100644
--- a/src/backend/executor/nodeIncrementalSort.c
+++ b/src/backend/executor/nodeIncrementalSort.c
@@ -69,7 +69,7 @@
  *	the entire result set is available.
  *
  *	The hybrid mode approach allows us to optimize for both very small
- *	groups (where the overhead of a new tuplesort is high) and very	large
+ *	groups (where the overhead of a new tuplesort is high) and very large
  *	groups (where we can lower cost by not having to sort on already sorted
  *	columns), albeit at some extra cost while switching between modes.
  *
diff --git a/src/backend/lib/rbtree.c b/src/backend/lib/rbtree.c
index f362dce220f..91eab40397f 100644
--- a/src/backend/lib/rbtree.c
+++ b/src/backend/lib/rbtree.c
@@ -87,7 +87,7 @@ static RBTNode sentinel =
  *
  * The freefunc should just be pfree or equivalent; it should NOT attempt
  * to free any subsidiary data, because the node passed to it may not contain
- * valid data!	freefunc can be NULL if caller doesn't require retail
+ * valid data!  freefunc can be NULL if caller doesn't require retail
  * space reclamation.
  *
  * The RBTree node is palloc'd in the caller's memory context.  Note that
diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c
index 4e721b705d5..6a7f87f17c8 100644
--- a/src/backend/libpq/be-secure-openssl.c
+++ b/src/backend/libpq/be-secure-openssl.c
@@ -1025,7 +1025,7 @@ load_dh_file(char *filename, bool isServerStart)
  *	Load hardcoded DH parameters.
  *
  *	If DH parameters cannot be loaded from a specified file, we can load
- *	the	hardcoded DH parameters supplied with the backend to prevent
+ *	the hardcoded DH parameters supplied with the backend to prevent
  *	problems.
  */
 static DH  *
diff --git a/src/backend/optimizer/path/clausesel.c b/src/backend/optimizer/path/clausesel.c
index 435438a1735..b7dd77ca882 100644
--- a/src/backend/optimizer/path/clausesel.c
+++ b/src/backend/optimizer/path/clausesel.c
@@ -610,7 +610,7 @@ treat_as_join_clause(PlannerInfo *root, Node *clause, RestrictInfo *rinfo,
 		 * Otherwise, it's a join if there's more than one base relation used.
 		 * We can optimize this calculation if an rinfo was passed.
 		 *
-		 * XXX	Since we know the clause is being evaluated at a join, the
+		 * XXX  Since we know the clause is being evaluated at a join, the
 		 * only way it could be single-relation is if it was delayed by outer
 		 * joins.  We intentionally count only baserels here, not OJs that
 		 * might be present in rinfo->clause_relids, so that we direct such
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index 7918bb6f0db..991b95ab812 100644
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -47,7 +47,7 @@
  * plan nodes below the LIMIT node) are set without regard to any LIMIT, so
  * that this equation works properly.  (Note: while path->rows is never zero
  * for ordinary relations, it is zero for paths for provably-empty relations,
- * so beware of division-by-zero.)	The LIMIT is applied as a top-level
+ * so beware of division-by-zero.)  The LIMIT is applied as a top-level
  * plan node.
  *
  * For largely historical reasons, most of the routines in this module use
@@ -2439,7 +2439,7 @@ cost_material(Path *path,
 	 * if it is exactly the same then there will be a cost tie between
 	 * nestloop with A outer, materialized B inner and nestloop with B outer,
 	 * materialized A inner.  The extra cost ensures we'll prefer
-	 * materializing the smaller rel.)	Note that this is normally a good deal
+	 * materializing the smaller rel.)  Note that this is normally a good deal
 	 * less than cpu_tuple_cost; which is OK because a Material plan node
 	 * doesn't do qual-checking or projection, so it's got less overhead than
 	 * most plan nodes.
@@ -3613,7 +3613,7 @@ final_cost_mergejoin(PlannerInfo *root, MergePath *path,
 	 * never spill to disk, since it only has to remember tuples back to the
 	 * last mark.  (If there are a huge number of duplicates, our other cost
 	 * factors will make the path so expensive that it probably won't get
-	 * chosen anyway.)	So we don't use cost_rescan here.
+	 * chosen anyway.)  So we don't use cost_rescan here.
 	 *
 	 * Note: keep this estimate in sync with create_mergejoin_plan's labeling
 	 * of the generated Material node.
diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c
index 9d4a9197ee6..b5ca895f9cb 100644
--- a/src/backend/optimizer/path/joinpath.c
+++ b/src/backend/optimizer/path/joinpath.c
@@ -230,7 +230,7 @@ add_paths_to_joinrel(PlannerInfo *root,
 	 * is usually no need to create a parameterized result path unless there
 	 * is a join order restriction that prevents joining one of our input rels
 	 * directly to the parameter source rel instead of joining to the other
-	 * input rel.  (But see allow_star_schema_join().)	This restriction
+	 * input rel.  (But see allow_star_schema_join().)  This restriction
 	 * reduces the number of parameterized paths we have to deal with at
 	 * higher join levels, without compromising the quality of the resulting
 	 * plan.  We express the restriction as a Relids set that must overlap the
diff --git a/src/backend/optimizer/path/pathkeys.c b/src/backend/optimizer/path/pathkeys.c
index c4e7f97f687..175bb1d407c 100644
--- a/src/backend/optimizer/path/pathkeys.c
+++ b/src/backend/optimizer/path/pathkeys.c
@@ -896,7 +896,7 @@ convert_subquery_pathkeys(PlannerInfo *root, RelOptInfo *rel,
 				 * expression is *not* volatile in the outer query: it's just
 				 * a Var referencing whatever the subquery emitted. (IOW, the
 				 * outer query isn't going to re-execute the volatile
-				 * expression itself.)	So this is okay.
+				 * expression itself.)  So this is okay.
 				 */
 				outer_ec =
 					get_eclass_for_sort_expr(root,
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index 134130476e4..38bc21ce7b7 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -936,7 +936,7 @@ use_physical_tlist(PlannerInfo *root, Path *path, int flags)
 	 * to emit any sort/group columns that are not simple Vars.  (If they are
 	 * simple Vars, they should appear in the physical tlist, and
 	 * apply_pathtarget_labeling_to_tlist will take care of getting them
-	 * labeled again.)	We also have to check that no two sort/group columns
+	 * labeled again.)  We also have to check that no two sort/group columns
 	 * are the same Var, else that element of the physical tlist would need
 	 * conflicting ressortgroupref labels.
 	 */
@@ -4210,7 +4210,7 @@ create_foreignscan_plan(PlannerInfo *root, ForeignPath *best_path,
 	 * 0, but there can be no Var with relid 0 in the rel's targetlist or the
 	 * restriction clauses, so we skip this in that case.  Note that any such
 	 * columns in base relations that were joined are assumed to be contained
-	 * in fdw_scan_tlist.)	This is a bit of a kluge and might go away
+	 * in fdw_scan_tlist.)  This is a bit of a kluge and might go away
 	 * someday, so we intentionally leave it out of the API presented to FDWs.
 	 */
 	scan_plan->fsSystemCol = false;
diff --git a/src/backend/optimizer/plan/initsplan.c b/src/backend/optimizer/plan/initsplan.c
index 904f710d593..95c3cdb201b 100644
--- a/src/backend/optimizer/plan/initsplan.c
+++ b/src/backend/optimizer/plan/initsplan.c
@@ -1373,7 +1373,7 @@ make_outerjoininfo(PlannerInfo *root,
 	 * Presently the executor cannot support FOR [KEY] UPDATE/SHARE marking of
 	 * rels appearing on the nullable side of an outer join. (It's somewhat
 	 * unclear what that would mean, anyway: what should we mark when a result
-	 * row is generated from no element of the nullable relation?)	So,
+	 * row is generated from no element of the nullable relation?)  So,
 	 * complain if any nullable rel is FOR [KEY] UPDATE/SHARE.
 	 *
 	 * You might be wondering why this test isn't made far upstream in the
diff --git a/src/backend/optimizer/prep/prepjointree.c b/src/backend/optimizer/prep/prepjointree.c
index 870d84b29d7..3f6d4e91f89 100644
--- a/src/backend/optimizer/prep/prepjointree.c
+++ b/src/backend/optimizer/prep/prepjointree.c
@@ -1578,7 +1578,7 @@ is_simple_subquery(PlannerInfo *root, Query *subquery, RangeTblEntry *rte,
 		 * outer-query quals, but we don't have enough info here to check
 		 * that.  Also, maybe this restriction could be removed if we forced
 		 * such refs to be wrapped in PlaceHolderVars, even when they're below
-		 * the nearest outer join?	But it's a pretty hokey usage, so not
+		 * the nearest outer join?  But it's a pretty hokey usage, so not
 		 * clear this is worth sweating over.)
 		 */
 		if (lowest_outer_join != NULL)
diff --git a/src/backend/optimizer/util/orclauses.c b/src/backend/optimizer/util/orclauses.c
index 85ecdfc14f2..380d541dc5a 100644
--- a/src/backend/optimizer/util/orclauses.c
+++ b/src/backend/optimizer/util/orclauses.c
@@ -167,7 +167,7 @@ extract_or_clause(RestrictInfo *or_rinfo, RelOptInfo *rel)
 	 * cheaper.  We'll strip those nodes from the returned tree, though,
 	 * meaning that fresh ones will be built if the clause is accepted as a
 	 * restriction clause.  This might seem wasteful --- couldn't we re-use
-	 * the existing RestrictInfos?	But that'd require assuming that
+	 * the existing RestrictInfos?  But that'd require assuming that
 	 * selectivity and other cached data is computed exactly the same way for
 	 * a restriction clause as for a join clause, which seems undesirable.
 	 */
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index d749b505785..a5438819876 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -508,7 +508,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
 								 * very small fuzz limit.  (We used to do an
 								 * exact cost comparison, but that results in
 								 * annoying platform-specific plan variations
-								 * due to roundoff in the cost estimates.)	If
+								 * due to roundoff in the cost estimates.)  If
 								 * things are still tied, arbitrarily keep
 								 * only the old path.  Notice that we will
 								 * keep only the old path even if the
diff --git a/src/backend/optimizer/util/var.c b/src/backend/optimizer/util/var.c
index c55c5f805b3..732546571e7 100644
--- a/src/backend/optimizer/util/var.c
+++ b/src/backend/optimizer/util/var.c
@@ -101,7 +101,7 @@ static Relids alias_relid_set(Query *query, Relids relids);
  *
  * NOTE: this is used on not-yet-planned expressions.  It may therefore find
  * bare SubLinks, and if so it needs to recurse into them to look for uplevel
- * references to the desired rtable level!	But when we find a completed
+ * references to the desired rtable level!  But when we find a completed
  * SubPlan, we only need to look at the parameters passed to the subplan.
  */
 Relids
diff --git a/src/backend/parser/parse_coerce.c b/src/backend/parser/parse_coerce.c
index 52787b67943..73bf0abcac7 100644
--- a/src/backend/parser/parse_coerce.c
+++ b/src/backend/parser/parse_coerce.c
@@ -1681,7 +1681,7 @@ select_common_typmod(ParseState *pstate, List *exprs, Oid common_type)
  *
  * Domains over arrays match ANYARRAY, and are immediately flattened to their
  * base type.  (Thus, for example, we will consider it a match if one ANYARRAY
- * argument is a domain over int4[] while another one is just int4[].)	Also
+ * argument is a domain over int4[] while another one is just int4[].)  Also
  * notice that such a domain does *not* match ANYNONARRAY.  The same goes
  * for ANYCOMPATIBLEARRAY and ANYCOMPATIBLENONARRAY.
  *
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 2552327d904..d78346e45c3 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -3208,7 +3208,7 @@ process_pm_child_exit(void)
 		}
 
 		/*
-		 * Was it the autovacuum launcher?	Normal exit can be ignored; we'll
+		 * Was it the autovacuum launcher?  Normal exit can be ignored; we'll
 		 * start a new one at the next iteration of the postmaster's main
 		 * loop, if necessary.  Any other exit condition is treated as a
 		 * crash.
diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index e18398cd428..e5ed4ed90b7 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -550,7 +550,7 @@ examine_attribute(Node *expr)
 	 * of the opclass, which is not interesting for our purposes.  (Note: if
 	 * we did anything with non-expression statistics columns, we'd need to
 	 * figure out where to get the correct type info from, but for now that's
-	 * not a problem.)	It's not clear whether anyone will care about the
+	 * not a problem.)  It's not clear whether anyone will care about the
 	 * typmod, but we store that too just in case.
 	 */
 	stats->attrtypid = exprType(expr);
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 926d000f2ea..7ea6ae7f690 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -1001,7 +1001,7 @@ BasicOpenFile(const char *fileName, int fileFlags)
  * This is exported for use by places that really want a plain kernel FD,
  * but need to be proof against running out of FDs.  Once an FD has been
  * successfully returned, it is the caller's responsibility to ensure that
- * it will not be leaked on ereport()!	Most users should *not* call this
+ * it will not be leaked on ereport()!  Most users should *not* call this
  * routine directly, but instead use the VFD abstraction level, which
  * provides protection against descriptor leaks as well as management of
  * files that need to be open for more than a short period of time.
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index a87372f33f9..4a6d034d962 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -3527,7 +3527,7 @@ PostPrepare_Locks(TransactionId xid)
 			 * the proclock would then be in the wrong hash chain.  Instead
 			 * use hash_update_hash_key.  (We used to create a new hash entry,
 			 * but that risks out-of-memory failure if other processes are
-			 * busy making proclocks too.)	We must unlink the proclock from
+			 * busy making proclocks too.)  We must unlink the proclock from
 			 * our procLink chain and put it into the new proc's chain, too.
 			 *
 			 * Note: the updated proclock hash key will still belong to the
@@ -3831,7 +3831,7 @@ GetBlockerStatusData(int blocked_pid)
 	 * In addition, to examine the lock grouping fields of any other backend,
 	 * we must hold all the hash partition locks.  (Only one of those locks is
 	 * actually relevant for any one lock group, but we can't know which one
-	 * ahead of time.)	It's fairly annoying to hold all those locks
+	 * ahead of time.)  It's fairly annoying to hold all those locks
 	 * throughout this, but it's no worse than GetLockStatusData(), and it
 	 * does have the advantage that we're guaranteed to return a
 	 * self-consistent instantaneous state.
diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c
index b2bd749d770..eefba40d39a 100644
--- a/src/backend/storage/smgr/smgr.c
+++ b/src/backend/storage/smgr/smgr.c
@@ -511,7 +511,7 @@ smgrextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
  *	smgrprefetch() -- Initiate asynchronous read of the specified block of a relation.
  *
  *		In recovery only, this can return false to indicate that a file
- *		doesn't	exist (presumably it has been dropped by a later WAL
+ *		doesn't exist (presumably it has been dropped by a later WAL
  *		record).
  */
 bool
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 5d439f27100..224db7216b8 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -4263,7 +4263,7 @@ PostgresMain(const char *dbname, const char *username)
 		 * future we might want to allow some timeout requests to survive, but
 		 * at minimum it'd be necessary to do reschedule_timeouts(), in case
 		 * we got here because of a query cancel interrupting the SIGALRM
-		 * interrupt handler.)	Note in particular that we must clear the
+		 * interrupt handler.)  Note in particular that we must clear the
 		 * statement and lock timeout indicators, to prevent any future plain
 		 * query cancels from being misreported as timeouts in case we're
 		 * forgetting a timeout cancel.
diff --git a/src/backend/tsearch/ts_parse.c b/src/backend/tsearch/ts_parse.c
index 25d98527786..8c4e1a9e327 100644
--- a/src/backend/tsearch/ts_parse.c
+++ b/src/backend/tsearch/ts_parse.c
@@ -50,7 +50,7 @@ typedef struct
 
 	/*
 	 * fields to store last variant to lexize (basically, thesaurus or similar
-	 * to, which wants	several lexemes
+	 * to, which wants several lexemes)
 	 */
 
 	ParsedLex  *lastRes;
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c
index 8f7522d1033..c7a196f960d 100644
--- a/src/backend/utils/adt/acl.c
+++ b/src/backend/utils/adt/acl.c
@@ -5091,7 +5091,7 @@ is_member_of_role_nosuper(Oid member, Oid role)
 
 
 /*
- * Is member an admin of role?	That is, is member the role itself (subject to
+ * Is member an admin of role?  That is, is member the role itself (subject to
  * restrictions below), a member (directly or indirectly) WITH ADMIN OPTION,
  * or a superuser?
  */
diff --git a/src/backend/utils/adt/like_support.c b/src/backend/utils/adt/like_support.c
index 9b603d42f3d..bdd0f5999ee 100644
--- a/src/backend/utils/adt/like_support.c
+++ b/src/backend/utils/adt/like_support.c
@@ -559,7 +559,7 @@ patternsel_common(PlannerInfo *root,
 	/*
 	 * Similarly, the exposed type of the left-hand side should be one of
 	 * those we know.  (Do not look at vardata.atttype, which might be
-	 * something binary-compatible but different.)	We can use it to identify
+	 * something binary-compatible but different.)  We can use it to identify
 	 * the comparison operators and the required type of the comparison
 	 * constant, much as in match_pattern_prefix().
 	 */
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index fe37e65af03..93cff772703 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -5512,7 +5512,7 @@ examine_simple_variable(PlannerInfo *root, Var *var,
 		 * Punt if subquery uses set operations or GROUP BY, as these will
 		 * mash underlying columns' stats beyond recognition.  (Set ops are
 		 * particularly nasty; if we forged ahead, we would return stats
-		 * relevant to only the leftmost subselect...)	DISTINCT is also
+		 * relevant to only the leftmost subselect...)  DISTINCT is also
 		 * problematic, but we check that later because there is a possibility
 		 * of learning something even with it.
 		 */
@@ -5603,7 +5603,7 @@ examine_simple_variable(PlannerInfo *root, Var *var,
 		/*
 		 * Otherwise, the Var comes from a FUNCTION, VALUES, or CTE RTE.  (We
 		 * won't see RTE_JOIN here because join alias Vars have already been
-		 * flattened.)	There's not much we can do with function outputs, but
+		 * flattened.)  There's not much we can do with function outputs, but
 		 * maybe someday try to be smarter about VALUES and/or CTEs.
 		 */
 	}
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c
index 170b3a3820b..762c33c7aab 100644
--- a/src/backend/utils/adt/varlena.c
+++ b/src/backend/utils/adt/varlena.c
@@ -1435,7 +1435,7 @@ text_position_next_internal(char *start_ptr, TextPositionState *state)
 			p = hptr;
 			while (*nptr == *p)
 			{
-				/* Matched it all?	If so, return 1-based position */
+				/* Matched it all?  If so, return 1-based position */
 				if (nptr == needle)
 					return (char *) p;
 				nptr--, p--;
@@ -3712,7 +3712,7 @@ textToQualifiedNameList(text *textval)
  * amount of stuff that needs to be allocated and freed.
  *
  * Inputs:
- *	rawstring: the input string; must be overwritable!	On return, it's
+ *	rawstring: the input string; must be overwritable!  On return, it's
  *			   been modified to contain the separated identifiers.
  *	separator: the separator punctuation expected between identifiers
  *			   (typically '.' or ',').  Whitespace may also appear around
@@ -3963,7 +3963,7 @@ SplitDirectoriesString(char *rawstring, char separator,
  * Be sure to update that if you have to change this.
  *
  * Inputs:
- *	rawstring: the input string; must be overwritable!	On return, it's
+ *	rawstring: the input string; must be overwritable!  On return, it's
  *			   been modified to contain the separated identifiers.
  *	separator: the separator punctuation expected between identifiers
  *			   (typically '.' or ',').  Whitespace may also appear around
diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c
index 77c2ba3f8f4..353fd390aee 100644
--- a/src/backend/utils/cache/plancache.c
+++ b/src/backend/utils/cache/plancache.c
@@ -401,7 +401,7 @@ CompleteCachedPlan(CachedPlanSource *plansource,
 		/*
 		 * Also save the current search_path in the query_context.  (This
 		 * should not generate much extra cruft either, since almost certainly
-		 * the path is already valid.)	Again, we don't really need this for
+		 * the path is already valid.)  Again, we don't really need this for
 		 * one-shot plans; and we *must* skip this for transaction control
 		 * commands, because this could result in catalog accesses.
 		 */
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 13f79873733..1598f7a3418 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -2582,7 +2582,7 @@ RelationClearRelation(Relation relation, bool rebuild)
 		 * sufficient to prevent any significant change in the rel's schema,
 		 * so the existing entry contents should be good enough for its
 		 * purposes; at worst we might be behind on statistics updates or the
-		 * like.  (See also CheckTableNotInUse() and its callers.)	These same
+		 * like.  (See also CheckTableNotInUse() and its callers.)  These same
 		 * remarks also apply to the cases above where we exit without having
 		 * done RelationReloadIndexInfo() yet.
 		 */
diff --git a/src/backend/utils/cache/ts_cache.c b/src/backend/utils/cache/ts_cache.c
index 7760ad764ea..4058dddb710 100644
--- a/src/backend/utils/cache/ts_cache.c
+++ b/src/backend/utils/cache/ts_cache.c
@@ -12,7 +12,7 @@
  * safe to hold onto a pointer to the cache entry while doing things that
  * might result in recognizing a cache invalidation.  Beware however that
  * subsidiary information might be deleted and reallocated somewhere else
- * if a cache inval and reval happens!	This does not look like it will be
+ * if a cache inval and reval happens!  This does not look like it will be
  * a big problem as long as parser and dictionary methods do not attempt
  * any database access.
  *
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index bc83f3577d7..ce5a6c987bd 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -3572,7 +3572,7 @@ set_config_option_ext(const char *name, const char *value,
 
 	/*
 	 * Should we set reset/stacked values?	(If so, the behavior is not
-	 * transactional.)	This is done either when we get a default value from
+	 * transactional.)  This is done either when we get a default value from
 	 * the database's/user's/client's default settings or when we reset a
 	 * value to its default.
 	 */
diff --git a/src/backend/utils/mmgr/dsa.c b/src/backend/utils/mmgr/dsa.c
index f5a62061a3e..20111fd6fe9 100644
--- a/src/backend/utils/mmgr/dsa.c
+++ b/src/backend/utils/mmgr/dsa.c
@@ -135,7 +135,7 @@ typedef size_t dsa_segment_index;
 
 /*
  * What is the lowest bin that holds segments that *might* have n contiguous
- * free pages?	There is no point in looking in segments in lower bins; they
+ * free pages?  There is no point in looking in segments in lower bins; they
  * definitely can't service a request for n free pages.
  */
 static inline size_t
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 7a58c33ace3..d6a3828ad31 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -687,7 +687,7 @@ find_matching_ts_config(const char *lc_type)
 	 * underscore (usual case) or a hyphen (Windows "locale name"; see
 	 * comments at IsoLocaleName()).
 	 *
-	 * XXX Should ' ' be a stop character?	This would select "norwegian" for
+	 * XXX Should ' ' be a stop character?  This would select "norwegian" for
 	 * the Windows locale "Norwegian (Nynorsk)_Norway.1252".  If we do so, we
 	 * should also accept the "nn" and "nb" Unix locales.
 	 *
diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c
index 9753a6d8682..b24e1f56525 100644
--- a/src/bin/pg_dump/dumputils.c
+++ b/src/bin/pg_dump/dumputils.c
@@ -707,7 +707,7 @@ variable_is_guc_list_quote(const char *name)
  * See comparable code in src/backend/utils/adt/varlena.c.
  *
  * Inputs:
- *	rawstring: the input string; must be overwritable!	On return, it's
+ *	rawstring: the input string; must be overwritable!  On return, it's
  *			   been modified to contain the separated identifiers.
  *	separator: the separator punctuation expected between identifiers
  *			   (typically '.' or ',').  Whitespace may also appear around
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 527c7651ab2..c730900891f 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -16151,7 +16151,7 @@ dumpIndex(Archive *fout, const IndxInfo *indxinfo)
 	/*
 	 * If there's an associated constraint, don't dump the index per se, but
 	 * do dump any comment for it.  (This is safe because dependency ordering
-	 * will have ensured the constraint is emitted first.)	Note that the
+	 * will have ensured the constraint is emitted first.)  Note that the
 	 * emitted comment has to be shown as depending on the constraint, not the
 	 * index, in such cases.
 	 */
diff --git a/src/bin/pg_test_timing/pg_test_timing.c b/src/bin/pg_test_timing/pg_test_timing.c
index c29d6f87629..ab8cf261ec3 100644
--- a/src/bin/pg_test_timing/pg_test_timing.c
+++ b/src/bin/pg_test_timing/pg_test_timing.c
@@ -1,6 +1,6 @@
 /*
  *	pg_test_timing.c
- *		tests overhead of timing calls and their monotonicity:	that
+ *		tests overhead of timing calls and their monotonicity: that
  *		they always move forward
  */
 
diff --git a/src/bin/pg_upgrade/server.c b/src/bin/pg_upgrade/server.c
index 820bddf3159..7a96fc7c79d 100644
--- a/src/bin/pg_upgrade/server.c
+++ b/src/bin/pg_upgrade/server.c
@@ -217,7 +217,7 @@ start_postmaster(ClusterInfo *cluster, bool report_and_exit_on_error)
 	strcat(socket_string,
 		   " -c listen_addresses='' -c unix_socket_permissions=0700");
 
-	/* Have a sockdir?	Tell the postmaster. */
+	/* Have a sockdir?  Tell the postmaster. */
 	if (cluster->sockdir)
 		snprintf(socket_string + strlen(socket_string),
 				 sizeof(socket_string) - strlen(socket_string),
diff --git a/src/interfaces/ecpg/ecpglib/prepare.c b/src/interfaces/ecpg/ecpglib/prepare.c
index ea1146f520f..46103acea90 100644
--- a/src/interfaces/ecpg/ecpglib/prepare.c
+++ b/src/interfaces/ecpg/ecpglib/prepare.c
@@ -519,7 +519,7 @@ AddStmtToCache(int lineno,		/* line # of statement */
 	for (ix = 0; ix < stmtCacheEntPerBucket; ++ix)
 	{
 		entry = &stmtCacheEntries[entNo];
-		if (!entry->stmtID[0])	/* unused entry  -	use it */
+		if (!entry->stmtID[0])	/* unused entry - use it */
 			break;
 		if (entry->execs < stmtCacheEntries[luEntNo].execs)
 			luEntNo = entNo;	/* save new 'least used' entry */
diff --git a/src/interfaces/ecpg/pgtypeslib/timestamp.c b/src/interfaces/ecpg/pgtypeslib/timestamp.c
index 54cc04addd2..6185fc18957 100644
--- a/src/interfaces/ecpg/pgtypeslib/timestamp.c
+++ b/src/interfaces/ecpg/pgtypeslib/timestamp.c
@@ -346,7 +346,7 @@ dttofmtasc_replace(timestamp * ts, date dDate, int dow, struct tm *tm,
 					break;
 
 					/*
-					 * The	preferred  date  and  time	representation	for
+					 * The preferred date and time representation for
 					 * the current locale.
 					 */
 				case 'c':
-- 
2.25.1

Reply via email to