doc review for v14

Started by Justin Pryzbyabout 5 years ago34 messages
#1Justin Pryzby
pryzby@telsasoft.com
18 attachment(s)

As I did last 2 years, I reviewed docs for v14...

This year I've started early, since it takes more than a little effort and it's
not much fun to argue the change in each individual hunk.

--
Justin Pryzby
System Administrator
Telsasoft
+1-952-707-8581

Attachments:

0004-Spaces-after-function-arguments.patchtext/x-diff; charset=us-asciiDownload
From 34e34f6793f1914824f00d07d5219612c0afe09c Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Nov 2020 12:48:26 -0600
Subject: [PATCH 04/17] Spaces after function arguments

See also: c5f42daa6077a4c309c5280a47d0e114c12dc572

https://www.postgresql.org/message-id/flat/5937341605894405%40mail.yandex.ru#c2a4bd4c587354896daf07e7646fe211
---
 doc/src/sgml/cube.sgml | 2 +-
 doc/src/sgml/func.sgml | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/cube.sgml b/doc/src/sgml/cube.sgml
index 3b39147d14..3dd89bb14d 100644
--- a/doc/src/sgml/cube.sgml
+++ b/doc/src/sgml/cube.sgml
@@ -321,7 +321,7 @@ SELECT c FROM test ORDER BY c ~&gt; 3 DESC LIMIT 5;
         Makes a one dimensional cube.
        </para>
        <para>
-        <literal>cube(1,2)</literal>
+        <literal>cube(1, 2)</literal>
         <returnvalue>(1),(2)</returnvalue>
        </para></entry>
       </row>
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index fb469500be..e7bba65182 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -1274,7 +1274,7 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
         (truncates towards zero)
        </para>
        <para>
-        <literal>div(9,4)</literal>
+        <literal>div(9, 4)</literal>
         <returnvalue>2</returnvalue>
        </para></entry>
       </row>
@@ -1493,7 +1493,7 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
         <type>bigint</type>, and <type>numeric</type>
        </para>
        <para>
-        <literal>mod(9,4)</literal>
+        <literal>mod(9, 4)</literal>
         <returnvalue>1</returnvalue>
        </para></entry>
       </row>
@@ -1975,7 +1975,7 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
         result in radians
        </para>
        <para>
-        <literal>atan2(1,0)</literal>
+        <literal>atan2(1, 0)</literal>
         <returnvalue>1.5707963267948966</returnvalue>
        </para></entry>
       </row>
@@ -1995,7 +1995,7 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
         result in degrees
        </para>
        <para>
-        <literal>atan2d(1,0)</literal>
+        <literal>atan2d(1, 0)</literal>
         <returnvalue>90</returnvalue>
        </para></entry>
       </row>
-- 
2.17.0

0001-pgindent-typos.not-a-pxtchtext/plain; charset=us-asciiDownload
From 5b5fec23af33b25f261a875dcd26c60564df0d89 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 25 Oct 2020 18:28:36 -0500
Subject: [PATCH] pgindent typos

Note that there's two changes to one line in lexi.c
---
 io.c   | 4 ++--
 lexi.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/io.c b/io.c
index fbaa5dd..a4812b6 100644
--- a/io.c
+++ b/io.c
@@ -452,8 +452,8 @@ fill_buffer(void)
  *
  * ALGORITHM: Put tabs and/or blanks into pobuf, then write pobuf.
  *
- * PARAMETERS: current		integer		The current column target
- * nteger		The desired column
+ * PARAMETERS: current		integer		The current column
+ * target                       integer		The desired column
  *
  * RETURNS: Integer value of the new column.  (If current >= target, no action is
  * taken, and current is returned.
diff --git a/lexi.c b/lexi.c
index d43723c..f01596a 100644
--- a/lexi.c
+++ b/lexi.c
@@ -442,7 +442,7 @@ lexi(struct parser_state *state)
 					 * then following sign is unary */
 	    state->last_u_d = true;	/* will make "int a -1" work */
 	return (ident);		/* the ident is not in the list */
-    }				/* end of procesing for alpanum character */
+    }				/* end of processing for alphanum character */
 
     /* Scan a non-alphanumeric token */
 
-- 
2.17.0

0001-typos-in-master.patchtext/x-diff; charset=us-asciiDownload
From 478a412b6475c1a7527cc58593f79c7ae5ba21cb Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 14 Nov 2020 23:09:21 -0600
Subject: [PATCH 01/17] typos in master

---
 doc/src/sgml/datatype.sgml           | 2 +-
 src/backend/access/transam/xlog.c    | 2 +-
 src/backend/partitioning/partprune.c | 4 ++--
 src/tools/msvc/README                | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 58d168c763..55d79c02f5 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -639,7 +639,7 @@ NUMERIC
 
     <para>
      The <literal>NaN</literal> (not a number) value is used to represent
-     undefined calculational results.  In general, any operation with
+     undefined computational results.  In general, any operation with
      a <literal>NaN</literal> input yields another <literal>NaN</literal>.
      The only exception is when the operation's other inputs are such that
      the same output would be obtained if the <literal>NaN</literal> were to
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 158d5fdedc..3fb3a4c107 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -10439,7 +10439,7 @@ get_sync_bit(int method)
 	 *
 	 * Never use O_DIRECT in walreceiver process for similar reasons; the WAL
 	 * written by walreceiver is normally read by the startup process soon
-	 * after its written. Also, walreceiver performs unaligned writes, which
+	 * after it's written. Also, walreceiver performs unaligned writes, which
 	 * don't work with O_DIRECT, so it is required for correctness too.
 	 */
 	if (!XLogIsNeeded() && !AmWalReceiverProcess())
diff --git a/src/backend/partitioning/partprune.c b/src/backend/partitioning/partprune.c
index 8e1187e31f..e7c7a6deb6 100644
--- a/src/backend/partitioning/partprune.c
+++ b/src/backend/partitioning/partprune.c
@@ -3119,7 +3119,7 @@ get_matching_range_bounds(PartitionPruneContext *context,
 	/*
 	 * If the smallest partition to return has MINVALUE (negative infinity) as
 	 * its lower bound, increment it to point to the next finite bound
-	 * (supposedly its upper bound), so that we don't advertently end up
+	 * (supposedly its upper bound), so that we don't inadvertently end up
 	 * scanning the default partition.
 	 */
 	if (minoff < boundinfo->ndatums && partindices[minoff] < 0)
@@ -3138,7 +3138,7 @@ get_matching_range_bounds(PartitionPruneContext *context,
 	 * If the previous greatest partition has MAXVALUE (positive infinity) as
 	 * its upper bound (something only possible to do with multi-column range
 	 * partitioning), we scan switch to it as the greatest partition to
-	 * return.  Again, so that we don't advertently end up scanning the
+	 * return.  Again, so that we don't inadvertently end up scanning the
 	 * default partition.
 	 */
 	if (maxoff >= 1 && partindices[maxoff] < 0)
diff --git a/src/tools/msvc/README b/src/tools/msvc/README
index d22fff331d..f1547594fd 100644
--- a/src/tools/msvc/README
+++ b/src/tools/msvc/README
@@ -81,7 +81,7 @@ VSObjectFactory.pm     factory module providing the code to create the
 Description of the internals of the Visual Studio build process
 ---------------------------------------------------------------
 By typing 'build' the user starts the build.bat wrapper which simply passes
-it's arguments to build.pl.
+its arguments to build.pl.
 In build.pl the user's buildenv.pl is used to set up the build environment
 (i. e. path to bison and flex). In addition his config.pl file is merged into
 config_default.pl to create the configuration arguments.
-- 
2.17.0

0002-producement-fcec6caafa2346b6c9d3ad5065e417733bd63cd9.patchtext/x-diff; charset=us-asciiDownload
From 356f9834845e6f8e7fd2304e743f34c8cf7fe609 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 25 Oct 2020 13:53:08 -0500
Subject: [PATCH 02/17] producement?  fcec6caafa2346b6c9d3ad5065e417733bd63cd9

Previously discussed at
https://www.postgresql.org/message-id/20201102062203.GA15770%40paquier.xyz

Should backpatch
---
 src/backend/utils/adt/xml.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c
index 4c299057a6..ab3151cefb 100644
--- a/src/backend/utils/adt/xml.c
+++ b/src/backend/utils/adt/xml.c
@@ -4535,11 +4535,11 @@ XmlTableFetchRow(TableFuncScanState *state)
 	xtCxt = GetXmlTableBuilderPrivateData(state, "XmlTableFetchRow");
 
 	/*
-	 * XmlTable returns table - set of composite values. The error context, is
-	 * used for producement more values, between two calls, there can be
-	 * created and used another libxml2 error context. It is libxml2 global
-	 * value, so it should be refreshed any time before any libxml2 usage,
-	 * that is finished by returning some value.
+	 * XmlTable returns a table-set of composite values. The error context is
+	 * used for providing more detail. Between two calls, other libxml2
+	 * error contexts might have been created and used ; since they're libxml2 
+	 * global values, they should be refreshed each time before any libxml2 usage
+	 * that finishes by returning some value.
 	 */
 	xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler);
 
-- 
2.17.0

0003-cannot.patchtext/x-diff; charset=us-asciiDownload
From 4952649d41a0936cc727666556a3c5e4e2062655 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 15 Nov 2020 10:23:32 -0600
Subject: [PATCH 03/17] cannot

---
 doc/src/sgml/catalogs.sgml            | 2 +-
 doc/src/sgml/protocol.sgml            | 4 ++--
 doc/src/sgml/ref/pg_verifybackup.sgml | 2 +-
 doc/src/sgml/wal.sgml                 | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index e0192822ff..1a23bf37ac 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -4489,7 +4489,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
        inherited columns are to be arranged.  The count starts at 1.
       </para>
       <para>
-       Indexes can not have multiple inheritance, since they can only inherit
+       Indexes cannot have multiple inheritance, since they can only inherit
        when using declarative partitioning.
       </para></entry>
      </row>
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 4899bacda7..8fc1427d0a 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -1532,8 +1532,8 @@ SELCT 1/0;<!-- this typo is intentional -->
     support to <productname>PostgreSQL</productname>.  In this case the
     connection must be closed, but the frontend might choose to open a fresh
     connection and proceed without requesting <acronym>GSSAPI</acronym>
-    encryption.  Given the length limits specified above, the ErrorMessage can
-    not be confused with a proper response from the server with an appropriate
+    encryption.  Given the length limits specified above, the ErrorMessage
+    cannot be confused with a proper response from the server with an appropriate
     length.
    </para>
 
diff --git a/doc/src/sgml/ref/pg_verifybackup.sgml b/doc/src/sgml/ref/pg_verifybackup.sgml
index a0989d3cd1..5f83c98706 100644
--- a/doc/src/sgml/ref/pg_verifybackup.sgml
+++ b/doc/src/sgml/ref/pg_verifybackup.sgml
@@ -40,7 +40,7 @@ PostgreSQL documentation
 
   <para>
    It is important to note that the validation which is performed by
-   <application>pg_verifybackup</application> does not and can not include
+   <application>pg_verifybackup</application> does not and cannot include
    every check which will be performed by a running server when attempting
    to make use of the backup. Even if you use this tool, you should still
    perform test restores and verify that the resulting databases work as
diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml
index f2de982626..18a0855c2a 100644
--- a/doc/src/sgml/wal.sgml
+++ b/doc/src/sgml/wal.sgml
@@ -677,7 +677,7 @@
    Independently of <varname>max_wal_size</varname>,
    the most recent <xref linkend="guc-wal-keep-size"/> megabytes of
    WAL files plus one additional WAL file are
-   kept at all times. Also, if WAL archiving is used, old segments can not be
+   kept at all times. Also, if WAL archiving is used, old segments cannot be
    removed or recycled until they are archived. If WAL archiving cannot keep up
    with the pace that WAL is generated, or if <varname>archive_command</varname>
    fails repeatedly, old WAL files will accumulate in <filename>pg_wal</filename>
-- 
2.17.0

0005-Fix-partially-updated-comment.patchtext/x-diff; charset=us-asciiDownload
From 0e04b2b34baa74e93d73accce81c552eb90c49bd Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 2 Dec 2020 17:22:49 -0600
Subject: [PATCH 05/17] Fix partially-updated comment

f0e44751d: implements partitioning and changed query to exclude partitioned tables
44c528810: Change the way pg_dump retrieves partitioning info (but failed to update comment)
0896ae561: Partially updated comment
---
 src/bin/pg_dump/pg_dump.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 8b1e5cc2b5..1ab98a2286 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -7018,10 +7018,7 @@ getInherits(Archive *fout, int *numInherits)
 	int			i_inhrelid;
 	int			i_inhparent;
 
-	/*
-	 * Find all the inheritance information, excluding implicit inheritance
-	 * via partitioning.
-	 */
+	/* find all the inheritance information */
 	appendPQExpBufferStr(query, "SELECT inhrelid, inhparent FROM pg_inherits");
 
 	res = ExecuteSqlQuery(fout, query->data, PGRES_TUPLES_OK);
-- 
2.17.0

0006-review-docs-for-pg12dev-broken-commas.patchtext/x-diff; charset=us-asciiDownload
From 0f8a643c73e16d719c6b39abc16530a4fcbc6ebc Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 28 Mar 2019 18:50:03 -0500
Subject: [PATCH 06/17] review docs for pg12dev (broken commas)

---
 doc/src/sgml/sources.sgml  | 2 +-
 src/bin/pg_upgrade/check.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 38a516080c..62cf2fded4 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -103,7 +103,7 @@ less -x4
     message text.  In addition there are optional elements, the most
     common of which is an error identifier code that follows the SQL spec's
     SQLSTATE conventions.
-    <function>ereport</function> itself is just a shell macro, that exists
+    <function>ereport</function> itself is just a shell macro that exists
     mainly for the syntactic convenience of making message generation
     look like a single function call in the C source code.  The only parameter
     accepted directly by <function>ereport</function> is the severity level.
diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c
index 6685d517ff..f3afea9d56 100644
--- a/src/bin/pg_upgrade/check.c
+++ b/src/bin/pg_upgrade/check.c
@@ -247,8 +247,8 @@ output_completion_banner(char *deletion_script_file_name)
 	}
 
 	pg_log(PG_REPORT,
-		   "Optimizer statistics are not transferred by pg_upgrade so,\n"
-		   "once you start the new server, consider running:\n"
+		   "Optimizer statistics are not transferred by pg_upgrade.\n"
+		   "Once you start the new server, consider running:\n"
 		   "    %s/vacuumdb %s--all --analyze-in-stages\n\n", new_cluster.bindir, user_specification.data);
 
 	if (deletion_script_file_name)
-- 
2.17.0

0007-pg_restore-must-be-specified-and-list.patchtext/x-diff; charset=us-asciiDownload
From d3143bb77a796253cd7ebd1e9983ae0eb723cb3d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Dec 2020 22:43:12 -0600
Subject: [PATCH 07/17] pg_restore: "must be specified" and --list

This was discussed here, but the idea got lost.
https://www.postgresql.org/message-id/flat/20190612170201.GA11881%40alvherre.pgsql#2984347ab074e6f198bd294fa41884df

Note that -d and -f are exclusive.
Perhaps we should also reject -d and -l ?
---
 src/bin/pg_dump/pg_restore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index 589b4aed53..742e4140eb 100644
--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -305,7 +305,7 @@ main(int argc, char **argv)
 	/* Complain if neither -f nor -d was specified (except if dumping TOC) */
 	if (!opts->cparams.dbname && !opts->filename && !opts->tocSummary)
 	{
-		pg_log_error("one of -d/--dbname and -f/--file must be specified");
+		pg_log_error("one of -d/--dbname, -f/--file or -l/--list must be specified");
 		exit_nicely(1);
 	}
 
-- 
2.17.0

0008-pg_dump-fix-pre-existing-docs-comments.patchtext/x-diff; charset=us-asciiDownload
From 5113e2dd28000b5c19ce6765dab80161e8f71849 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 21 Dec 2020 00:32:32 -0600
Subject: [PATCH 08/17] pg_dump: fix pre-existing docs/comments

---
 doc/src/sgml/ref/pg_dump.sgml         | 2 +-
 src/bin/pg_dump/pg_backup_directory.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index 0aa35cf0c3..dcb25dc3cd 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -621,7 +621,7 @@ PostgreSQL documentation
       <listitem>
        <para>
         Specify the compression level to use.  Zero means no compression.
-        For the custom archive format, this specifies compression of
+        For the custom and directory archive formats, this specifies compression of
         individual table-data segments, and the default is to compress
         at a moderate level.
         For plain text output, setting a nonzero compression level causes
diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c
index 48fa7cb1a3..650b542fce 100644
--- a/src/bin/pg_dump/pg_backup_directory.c
+++ b/src/bin/pg_dump/pg_backup_directory.c
@@ -4,7 +4,7 @@
  *
  *	A directory format dump is a directory, which contains a "toc.dat" file
  *	for the TOC, and a separate file for each data entry, named "<oid>.dat".
- *	Large objects (BLOBs) are stored in separate files named "blob_<uid>.dat",
+ *	Large objects (BLOBs) are stored in separate files named "blob_<oid>.dat",
  *	and there's a plain-text TOC file for them called "blobs.toc". If
  *	compression is used, each data file is individually compressed and the
  *	".gz" suffix is added to the filenames. The TOC files are never
-- 
2.17.0

0009-Fix-malformed-comment.patchtext/x-diff; charset=us-asciiDownload
From 2e08805ffcb088e2a53edbd7f917ac04405af83a Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 12 Dec 2020 00:11:37 -0600
Subject: [PATCH 09/17] Fix malformed comment..

broken since bf50caf10.
---
 src/bin/pg_dump/pg_backup_archiver.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 177360ed6e..6a5a22637b 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -329,9 +329,12 @@ struct _archiveHandle
 	DumpId	   *tableDataId;	/* TABLE DATA ids, indexed by table dumpId */
 
 	struct _tocEntry *currToc;	/* Used when dumping data */
-	int			compression;	/* Compression requested on open Possible
-								 * values for compression: -1
-								 * Z_DEFAULT_COMPRESSION 0	COMPRESSION_NONE
+	int			compression;	/*---------
+								 * Compression requested on open
+								 * Possible values for compression:
+								 * -2	ZSTD_COMPRESSION
+								 * -1	Z_DEFAULT_COMPRESSION
+								 *  0	COMPRESSION_NONE
 								 * 1-9 levels for gzip compression */
 	bool		dosync;			/* data requested to be synced on sight */
 	ArchiveMode mode;			/* File mode - r or w */
-- 
2.17.0

0010-Doc-review-for-min_dynamic_shared_memory-84b1c63ad.patchtext/x-diff; charset=us-asciiDownload
From d8c88d949a7d165d89f928fbb21847213416f06a Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 19 Dec 2020 03:30:25 -0600
Subject: [PATCH 10/17] Doc review for min_dynamic_shared_memory: 84b1c63ad

---
 doc/src/sgml/config.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 7c9045fda0..87d72f814b 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -1939,13 +1939,13 @@ include_dir 'conf.d'
       <listitem>
        <para>
         Specifies the amount of memory that should be allocated at server
-        startup time for use by parallel queries.  When this memory region is
+        startup for use by parallel queries.  When this memory region is
         insufficient or exhausted by concurrent queries, new parallel queries
         try to allocate extra shared memory temporarily from the operating
         system using the method configured with
         <varname>dynamic_shared_memory_type</varname>, which may be slower due
         to memory management overheads.  Memory that is allocated at startup
-        time with <varname>min_dynamic_shared_memory</varname> is affected by
+        with <varname>min_dynamic_shared_memory</varname> is affected by
         the <varname>huge_pages</varname> setting on operating systems where
         that is supported, and may be more likely to benefit from larger pages
         on operating systems where that is managed automatically.
-- 
2.17.0

0011-Doc-review-for-pg_stat_replication_slots-986816750.patchtext/x-diff; charset=us-asciiDownload
From d2d06b49e9d1dac229421dd9be83196328720345 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 19 Dec 2020 04:26:03 -0600
Subject: [PATCH 11/17] Doc review for pg_stat_replication_slots: 986816750

---
 doc/src/sgml/monitoring.sgml | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index ea5a56f66d..5fa8c351e6 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -317,7 +317,7 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
      <row>
       <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
       <entry>One row per replication slot, showing statistics about
-       replication slot usage.
+       the replication slot's usage.
        See <link linkend="monitoring-pg-stat-replication-slots-view">
        <structname>pg_stat_replication_slots</structname></link> for details.
       </entry>
@@ -2600,10 +2600,10 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
         <structfield>spill_txns</structfield> <type>bigint</type>
        </para>
        <para>
-        Number of transactions spilled to disk after the memory used by
-        logical decoding of changes from WAL for this slot exceeds
+        Number of transactions spilled to disk because the memory used by
+        logical decoding of changes from WAL for this slot exceeded
         <literal>logical_decoding_work_mem</literal>. The counter gets
-        incremented both for toplevel transactions and subtransactions.
+        incremented for both toplevel transactions and subtransactions.
       </para></entry>
      </row>
 
@@ -2613,8 +2613,8 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
        </para>
        <para>
         Number of times transactions were spilled to disk while decoding changes
-        from WAL for this slot. Transactions may get spilled repeatedly, and
-        this counter gets incremented on every such invocation.
+        from WAL for this slot. A given transaction may be spilled multiple times, and
+        this counter is incremented each time.
       </para></entry>
      </row>
 
@@ -2636,10 +2636,10 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
        </para>
        <para>
         Number of in-progress transactions streamed to the decoding output plugin
-        after the memory used by logical decoding of changes from WAL for this
-        slot exceeds <literal>logical_decoding_work_mem</literal>. Streaming only
+        because the memory used by logical decoding of changes from WAL for this
+        slot exceeded <literal>logical_decoding_work_mem</literal>. Streaming only
         works with toplevel transactions (subtransactions can't be streamed
-        independently), so the counter does not get incremented for subtransactions.
+        independently), so the counter is not incremented for subtransactions.
        </para></entry>
      </row>
 
@@ -2650,8 +2650,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
        <para>
         Number of times in-progress transactions were streamed to the decoding
         output plugin while decoding changes from WAL for this slot. Transactions
-        may get streamed repeatedly, and this counter gets incremented on every
-        such invocation.
+        may be streamed multiple times, and this counter is incremented each time.
       </para></entry>
      </row>
 
@@ -4970,10 +4969,10 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
        </para>
        <para>
          Resets statistics to zero for a single replication slot, or for all
-         replication slots in the cluster.  The argument can be either the name
-         of the slot to reset the stats or NULL.  If the argument is NULL, all
-         counters shown in the <structname>pg_stat_replication_slots</structname>
-         view for all replication slots are reset.
+         replication slots in the cluster.  The argument can be either NULL or the name
+         of a slot for which stats are to be reset.  If the argument is NULL, all
+         counters in the <structname>pg_stat_replication_slots</structname>
+         view are reset for all replication slots.
        </para>
        <para>
          This function is restricted to superusers by default, but other users
-- 
2.17.0

0012-Doc-review-for-pg_stat_wal-8d9a93596.patchtext/x-diff; charset=us-asciiDownload
From cee81f1d29ea7c7ee0a4bc7da80ee10903865229 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 19 Dec 2020 04:06:43 -0600
Subject: [PATCH 12/17] Doc review for pg_stat_wal: 8d9a93596

---
 doc/src/sgml/monitoring.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 5fa8c351e6..941cf1877b 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -3476,7 +3476,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
        <structfield>wal_buffers_full</structfield> <type>bigint</type>
       </para>
       <para>
-       Number of times WAL data was written to the disk because WAL buffers got full
+       Number of times WAL data was written to disk because WAL buffers became full
       </para></entry>
      </row>
 
-- 
2.17.0

0013-Doc-review-for-logical-decoding-stream-methods-45fdc.patchtext/x-diff; charset=us-asciiDownload
From 760f6ecff89194571524d610e5ece2dbeec6d373 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 19 Dec 2020 03:27:23 -0600
Subject: [PATCH 13/17] Doc review for logical decoding stream methods:
 45fdc9738

See also:
9e0f87a4955ede0769d2f9a93171145b6ddab901
8e90ec5580d5345fef31005d7cc2215ba2125070
---
 doc/src/sgml/logicaldecoding.sgml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index 813a037fac..ca78a81e9c 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -953,11 +953,11 @@ stream_commit_cb(...);  &lt;-- commit of the streamed transaction
    <para>
     Similar to spill-to-disk behavior, streaming is triggered when the total
     amount of changes decoded from the WAL (for all in-progress transactions)
-    exceeds limit defined by <varname>logical_decoding_work_mem</varname> setting.
-    At that point the largest toplevel transaction (measured by amount of memory
+    exceeds the limit defined by <varname>logical_decoding_work_mem</varname> setting.
+    At that point, the largest toplevel transaction (measured by the amount of memory
     currently used for decoded changes) is selected and streamed.  However, in
-    some cases we still have to spill to the disk even if streaming is enabled
-    because if we cross the memory limit but we still have not decoded the
+    some cases we still have to spill to disk even if streaming is enabled
+    because we exceed the memory threshold but still have not decoded the
     complete tuple e.g., only decoded toast table insert but not the main table
     insert.
    </para>
-- 
2.17.0

0014-Doc-review-for-amcheck-access-.-is-performed-866e24d.patchtext/x-diff; charset=us-asciiDownload
From 8d039f846a3d82d152a4b46aeec8593d760d73b5 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 19 Dec 2020 05:01:24 -0600
Subject: [PATCH 14/17] Doc review for amcheck: access .. is performed
 866e24d47db1743dfcff5bd595b57e3a143f2cb1

See also 4c49d8fc15eeb1dc69b0ddb2d986a1884a5d7f5f
---
 doc/src/sgml/amcheck.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/amcheck.sgml b/doc/src/sgml/amcheck.sgml
index 99fad708bf..8dfb01a77b 100644
--- a/doc/src/sgml/amcheck.sgml
+++ b/doc/src/sgml/amcheck.sgml
@@ -525,7 +525,7 @@ SET client_min_messages = DEBUG1;
   designed to diagnose corruption without undue risk.  It cannot guard
   against all causes of backend crashes, as even executing the calling
   query could be unsafe on a badly corrupted system.   Access to <link
-  linkend="catalogs-overview">catalog tables</link> are performed and could
+  linkend="catalogs-overview">catalog tables</link> is performed and could
   be problematic if the catalogs themselves are corrupted.
  </para>
 
-- 
2.17.0

0015-Doc-review-for-prepared-statements-4a36eab79a193700b.patchtext/x-diff; charset=us-asciiDownload
From 2e5cbad993c3f972709f148688dc7acb34a0999f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 19 Dec 2020 05:27:07 -0600
Subject: [PATCH 15/17] Doc review for prepared statements:
 4a36eab79a193700b7b65baf6c09c795c90c02c6

---
 doc/src/sgml/ref/prepare.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/prepare.sgml b/doc/src/sgml/ref/prepare.sgml
index 22ce28e517..aae91946c7 100644
--- a/doc/src/sgml/ref/prepare.sgml
+++ b/doc/src/sgml/ref/prepare.sgml
@@ -184,7 +184,7 @@ EXPLAIN EXECUTE <replaceable>name</replaceable>(<replaceable>parameter_values</r
    analysis and planning of the statement, <productname>PostgreSQL</productname> will
    force re-analysis and re-planning of the statement before using it
    whenever database objects used in the statement have undergone
-   definitional (DDL) changes or the planner statistics of them have
+   definitional (DDL) changes or their planner statistics have
    been updated since the previous use of the prepared
    statement.  Also, if the value of <xref linkend="guc-search-path"/> changes
    from one use to the next, the statement will be re-parsed using the new
-- 
2.17.0

0016-Doc-review-for-WAL-counters-amount-of-bytes.patchtext/x-diff; charset=us-asciiDownload
From 2ee65cf6eacd78be3eef6a2478b83804870f0e95 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 19 Dec 2020 05:32:16 -0600
Subject: [PATCH 16/17] Doc review for WAL counters: "amount of bytes"

6b466bf5f pg_stat_statements (should backpatch to v13)
01469241b pg_stat_wal

It's correct to say "number of bytes" or "amount of WAL in bytes" but not
"amount of bytes".

I suggested "number of bytes" in April but didn't argue for it.
https://www.postgresql.org/message-id/20200406163420.GE2228%40telsasoft.com
https://www.postgresql.org/message-id/CAOBaU_Z6BKS01-DvSU30UMOKLHJGdrvehJbhqfOXcMq%3DYzHXUA%40mail.gmail.com
---
 contrib/pg_stat_statements/pg_stat_statements.c | 2 +-
 doc/src/sgml/monitoring.sgml                    | 2 +-
 doc/src/sgml/pgstatstatements.sgml              | 2 +-
 doc/src/sgml/ref/explain.sgml                   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c
index 00eeaf1057..ac83a2c571 100644
--- a/contrib/pg_stat_statements/pg_stat_statements.c
+++ b/contrib/pg_stat_statements/pg_stat_statements.c
@@ -191,7 +191,7 @@ typedef struct Counters
 	double		usage;			/* usage factor */
 	int64		wal_records;	/* # of WAL records generated */
 	int64		wal_fpi;		/* # of WAL full page images generated */
-	uint64		wal_bytes;		/* total amount of WAL bytes generated */
+	uint64		wal_bytes;		/* total number of WAL bytes generated */
 } Counters;
 
 /*
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 941cf1877b..d26fb57ab6 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -3467,7 +3467,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
        <structfield>wal_bytes</structfield> <type>numeric</type>
       </para>
       <para>
-       Total amount of WAL bytes generated
+       Total amount of WAL generated in bytes
       </para></entry>
      </row>
 
diff --git a/doc/src/sgml/pgstatstatements.sgml b/doc/src/sgml/pgstatstatements.sgml
index 126ee31d9f..3de4a2f754 100644
--- a/doc/src/sgml/pgstatstatements.sgml
+++ b/doc/src/sgml/pgstatstatements.sgml
@@ -360,7 +360,7 @@
        <structfield>wal_bytes</structfield> <type>numeric</type>
       </para>
       <para>
-       Total amount of WAL bytes generated by the statement
+       Total amount of WAL generated by the statement (bytes)
       </para></entry>
      </row>
     </tbody>
diff --git a/doc/src/sgml/ref/explain.sgml b/doc/src/sgml/ref/explain.sgml
index b0ccdd26e7..9eaff92682 100644
--- a/doc/src/sgml/ref/explain.sgml
+++ b/doc/src/sgml/ref/explain.sgml
@@ -198,7 +198,7 @@ ROLLBACK;
     <listitem>
      <para>
       Include information on WAL record generation. Specifically, include the
-      number of records, number of full page images (fpi) and amount of WAL
+      number of records, number of full page images (fpi) and number of WAL
       bytes generated.  In text format, only non-zero values are printed.  This
       parameter may only be used when <literal>ANALYZE</literal> is also
       enabled.  It defaults to <literal>FALSE</literal>.
-- 
2.17.0

0017-Doc-review-for-multiranges-6df7a9698.patchtext/x-diff; charset=us-asciiDownload
From e5b4e3829de309ace1d0e867deb24aa240a83eb1 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 20 Dec 2020 00:04:17 -0600
Subject: [PATCH 17/17] Doc review for multiranges: 6df7a9698

---
 doc/src/sgml/rangetypes.sgml      | 2 +-
 doc/src/sgml/ref/create_type.sgml | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/rangetypes.sgml b/doc/src/sgml/rangetypes.sgml
index 83aa9bc4e9..859079c69c 100644
--- a/doc/src/sgml/rangetypes.sgml
+++ b/doc/src/sgml/rangetypes.sgml
@@ -29,7 +29,7 @@
 
  <para>
   Every range type has a corresponding multirange type. A multirange is
-  an ordered list of non-continguous, non-empty, non-null ranges. Most
+  an ordered list of non-contiguous, non-empty, non-null ranges. Most
   range operators also work on multiranges, and they have a few functions
   of their own.
  </para>
diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgml
index 7d2d6aa0af..0b24a55505 100644
--- a/doc/src/sgml/ref/create_type.sgml
+++ b/doc/src/sgml/ref/create_type.sgml
@@ -180,10 +180,10 @@ CREATE TYPE <replaceable class="parameter">name</replaceable>
     The optional <replaceable class="parameter">multirange_type_name</replaceable>
     parameter specifies the name of the corresponding multirange type.  If not
     specified, this name is chosen automatically as follows.
-    If range type name contains <literal>range</literal> substring, then
-    multirange type name is formed by replacement of the <literal>range</literal>
-    substring with <literal>multirange</literal> substring in the range
-    type name.  Otherwise, multirange type name is formed by appending
+    If the range type name contains the substring <literal>range</literal>, then
+    the multirange type name is formed by replacement of the <literal>range</literal>
+    substring with <literal>multirange</literal> in the range
+    type name.  Otherwise, the multirange type name is formed by appending a
     <literal>_multirange</literal> suffix to the range type name.
    </para>
   </refsect2>
-- 
2.17.0

#2Michael Paquier
michael@paquier.xyz
In reply to: Justin Pryzby (#1)
Re: doc review for v14

On Mon, Dec 21, 2020 at 10:11:53PM -0600, Justin Pryzby wrote:

As I did last 2 years, I reviewed docs for v14...

Thanks for gathering all that!

This year I've started early, since it takes more than a little effort and it's
not much fun to argue the change in each individual hunk.

0001-pgindent-typos.not-a-patch touches pg_bsd_indent.

/*
-	 * XmlTable returns table - set of composite values. The error context, is
-	 * used for producement more values, between two calls, there can be
-	 * created and used another libxml2 error context. It is libxml2 global
-	 * value, so it should be refreshed any time before any libxml2 usage,
-	 * that is finished by returning some value.
+	 * XmlTable returns a table-set of composite values. The error context is
+	 * used for providing more detail. Between two calls, other libxml2
+	 * error contexts might have been created and used ; since they're libxml2 
+	 * global values, they should be refreshed each time before any libxml2 usage
+	 * that finishes by returning some value.
*/

That's indeed incorrect, but I am not completely sure if what you have
here is correct either. I'll try to study this code a bit more first,
though I have said that once in the past. :p

--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -305,7 +305,7 @@ main(int argc, char **argv)
/* Complain if neither -f nor -d was specified (except if dumping TOC) */
if (!opts->cparams.dbname && !opts->filename && !opts->tocSummary)
{
-		pg_log_error("one of -d/--dbname and -f/--file must be specified");
+		pg_log_error("one of -d/--dbname, -f/--file or -l/--list must be specified");
exit_nicely(1);
}

You have forgotten to update the TAP test pg_dump/t/001_basic.pl.
The message does not seem completely incorrect to me either. Hmm.
Restraining more the set of options is something to consider, though
it could be annoying. I have discarded this one for now.

Specifies the amount of memory that should be allocated at server
-        startup time for use by parallel queries.  When this memory region is
+        startup for use by parallel queries.  When this memory region is
insufficient or exhausted by concurrent queries, new parallel queries
try to allocate extra shared memory temporarily from the operating
system using the method configured with
<varname>dynamic_shared_memory_type</varname>, which may be slower due
to memory management overheads.  Memory that is allocated at startup
-        time with <varname>min_dynamic_shared_memory</varname> is affected by
+        with <varname>min_dynamic_shared_memory</varname> is affected by
the <varname>huge_pages</varname> setting on operating systems where
that is supported, and may be more likely to benefit from larger pages
on operating systems where that is managed automatically.

The current formulation is not that confusing, but I agree that this
is an improvement. Thomas, you are behind this one. What do you
think?

I have applied most of it on HEAD, except 0011 and the things noted
above. Thanks again.
--
Michael

#3Justin Pryzby
pryzby@telsasoft.com
In reply to: Michael Paquier (#2)
7 attachment(s)
Re: doc review for v14

On Thu, Dec 24, 2020 at 05:12:02PM +0900, Michael Paquier wrote:

I have applied most of it on HEAD, except 0011 and the things noted
above. Thanks again.

Thank you.

I see that I accidentally included ZSTD_COMPRESSION in pg_backup_archiver.h
while cherry-picking from the branch where I first fixed this. Sorry :(

0001-pgindent-typos.not-a-patch touches pg_bsd_indent.

I'm hoping that someone will apply it there, but I realize that access to its
repository is tightly controlled :)

On Thu, Dec 24, 2020 at 05:12:02PM +0900, Michael Paquier wrote:

Restraining more the set of options is something to consider, though
it could be annoying. I have discarded this one for now.

Even though its -d is unused, I guess since wouldn't serve any significant
purpose, we shouldn't make pg_restore -l -d fail for no reason.

I think a couple of these should be backpatched.
doc/src/sgml/ref/pg_dump.sgml
doc/src/sgml/sources.sgml
doc/src/sgml/cube.sgml?
doc/src/sgml/func.sgml?

--
Justin

Attachments:

0006-pg_restore-must-be-specified-and-list.patchtext/x-diff; charset=us-asciiDownload
From c73d4ac6b1ef5c0e6ca5b19863b424de95492cff Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Dec 2020 22:43:12 -0600
Subject: [PATCH 6/7] pg_restore: "must be specified" and --list

This was discussed here, but the idea got lost.
https://www.postgresql.org/message-id/flat/20190612170201.GA11881%40alvherre.pgsql#2984347ab074e6f198bd294fa41884df
---
 src/bin/pg_dump/pg_restore.c   | 2 +-
 src/bin/pg_dump/t/001_basic.pl | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index 589b4aed53..f6e6e41329 100644
--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -305,7 +305,7 @@ main(int argc, char **argv)
 	/* Complain if neither -f nor -d was specified (except if dumping TOC) */
 	if (!opts->cparams.dbname && !opts->filename && !opts->tocSummary)
 	{
-		pg_log_error("one of -d/--dbname and -f/--file must be specified");
+		pg_log_error("one of -d/--dbname, -f/--file, or -l/--list must be specified");
 		exit_nicely(1);
 	}
 
diff --git a/src/bin/pg_dump/t/001_basic.pl b/src/bin/pg_dump/t/001_basic.pl
index 083fb3ad08..8280914c2a 100644
--- a/src/bin/pg_dump/t/001_basic.pl
+++ b/src/bin/pg_dump/t/001_basic.pl
@@ -63,8 +63,8 @@ command_fails_like(
 
 command_fails_like(
 	['pg_restore'],
-	qr{\Qpg_restore: error: one of -d/--dbname and -f/--file must be specified\E},
-	'pg_restore: error: one of -d/--dbname and -f/--file must be specified');
+	qr{\Qpg_restore: error: one of -d/--dbname, -f/--file, or -l/--list must be specified\E},
+	'pg_restore: error: one of -d/--dbname, -f/--file, or -l/--list must be specified');
 
 command_fails_like(
 	[ 'pg_restore', '-s', '-a', '-f -' ],
-- 
2.17.0

0007-Remove-ZSTD_COMPRESSION-accidentially-included-at-90.patchtext/x-diff; charset=us-asciiDownload
From 70093215a5aed14686c7b5f9d24b38960824dd57 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 24 Dec 2020 02:38:52 -0600
Subject: [PATCH 7/7] Remove ZSTD_COMPRESSION, accidentially included at
 90fbf7c57

---
 src/bin/pg_dump/pg_backup_archiver.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 0847573339..a8ea5c7eae 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -332,7 +332,6 @@ struct _archiveHandle
 	int			compression;	/*---------
 								 * Compression requested on open().
 								 * Possible values for compression:
-								 * -2	ZSTD_COMPRESSION
 								 * -1	Z_DEFAULT_COMPRESSION
 								 *  0	COMPRESSION_NONE
 								 * 1-9 levels for gzip compression
-- 
2.17.0

0001-typos-in-master.patchtext/x-diff; charset=us-asciiDownload
From 9c24fa421e423edb29fc866a70e935843dab2804 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 14 Nov 2020 23:09:21 -0600
Subject: [PATCH 1/7] typos in master

---
 doc/src/sgml/datatype.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 58d168c763..55d79c02f5 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -639,7 +639,7 @@ NUMERIC
 
     <para>
      The <literal>NaN</literal> (not a number) value is used to represent
-     undefined calculational results.  In general, any operation with
+     undefined computational results.  In general, any operation with
      a <literal>NaN</literal> input yields another <literal>NaN</literal>.
      The only exception is when the operation's other inputs are such that
      the same output would be obtained if the <literal>NaN</literal> were to
-- 
2.17.0

0002-producement-fcec6caafa2346b6c9d3ad5065e417733bd63cd9.patchtext/x-diff; charset=us-asciiDownload
From b4f8290d322a2d783352aff3a4b134acafa0a13c Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 25 Oct 2020 13:53:08 -0500
Subject: [PATCH 2/7] producement?  fcec6caafa2346b6c9d3ad5065e417733bd63cd9

Previously discussed at
https://www.postgresql.org/message-id/20201102062203.GA15770%40paquier.xyz

Should backpatch
---
 src/backend/utils/adt/xml.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c
index 4c299057a6..ab3151cefb 100644
--- a/src/backend/utils/adt/xml.c
+++ b/src/backend/utils/adt/xml.c
@@ -4535,11 +4535,11 @@ XmlTableFetchRow(TableFuncScanState *state)
 	xtCxt = GetXmlTableBuilderPrivateData(state, "XmlTableFetchRow");
 
 	/*
-	 * XmlTable returns table - set of composite values. The error context, is
-	 * used for producement more values, between two calls, there can be
-	 * created and used another libxml2 error context. It is libxml2 global
-	 * value, so it should be refreshed any time before any libxml2 usage,
-	 * that is finished by returning some value.
+	 * XmlTable returns a table-set of composite values. The error context is
+	 * used for providing more detail. Between two calls, other libxml2
+	 * error contexts might have been created and used ; since they're libxml2 
+	 * global values, they should be refreshed each time before any libxml2 usage
+	 * that finishes by returning some value.
 	 */
 	xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler);
 
-- 
2.17.0

0003-cannot.patchtext/x-diff; charset=us-asciiDownload
From e2b22163feb706ecba670108b6760526ddb1d57b Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 15 Nov 2020 10:23:32 -0600
Subject: [PATCH 3/7] cannot

---
 doc/src/sgml/protocol.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 4899bacda7..8fc1427d0a 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -1532,8 +1532,8 @@ SELCT 1/0;<!-- this typo is intentional -->
     support to <productname>PostgreSQL</productname>.  In this case the
     connection must be closed, but the frontend might choose to open a fresh
     connection and proceed without requesting <acronym>GSSAPI</acronym>
-    encryption.  Given the length limits specified above, the ErrorMessage can
-    not be confused with a proper response from the server with an appropriate
+    encryption.  Given the length limits specified above, the ErrorMessage
+    cannot be confused with a proper response from the server with an appropriate
     length.
    </para>
 
-- 
2.17.0

0004-Doc-review-for-min_dynamic_shared_memory-84b1c63ad.patchtext/x-diff; charset=us-asciiDownload
From 4f78473ed9063464e2510bbd433e3ebc3b9a773e Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 19 Dec 2020 03:30:25 -0600
Subject: [PATCH 4/7] Doc review for min_dynamic_shared_memory: 84b1c63ad

---
 doc/src/sgml/config.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index ce1fed7dfb..6b2acab9f4 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -1941,13 +1941,13 @@ include_dir 'conf.d'
       <listitem>
        <para>
         Specifies the amount of memory that should be allocated at server
-        startup time for use by parallel queries.  When this memory region is
+        startup for use by parallel queries.  When this memory region is
         insufficient or exhausted by concurrent queries, new parallel queries
         try to allocate extra shared memory temporarily from the operating
         system using the method configured with
         <varname>dynamic_shared_memory_type</varname>, which may be slower due
         to memory management overheads.  Memory that is allocated at startup
-        time with <varname>min_dynamic_shared_memory</varname> is affected by
+        with <varname>min_dynamic_shared_memory</varname> is affected by
         the <varname>huge_pages</varname> setting on operating systems where
         that is supported, and may be more likely to benefit from larger pages
         on operating systems where that is managed automatically.
-- 
2.17.0

0005-Doc-review-for-pg_stat_replication_slots-986816750.patchtext/x-diff; charset=us-asciiDownload
From 0ea9b2e4b30e3304b9db434319cca13bda079e99 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 19 Dec 2020 04:26:03 -0600
Subject: [PATCH 5/7] Doc review for pg_stat_replication_slots: 986816750

---
 doc/src/sgml/monitoring.sgml | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 243b437351..d26fb57ab6 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -317,7 +317,7 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
      <row>
       <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
       <entry>One row per replication slot, showing statistics about
-       replication slot usage.
+       the replication slot's usage.
        See <link linkend="monitoring-pg-stat-replication-slots-view">
        <structname>pg_stat_replication_slots</structname></link> for details.
       </entry>
@@ -2600,10 +2600,10 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
         <structfield>spill_txns</structfield> <type>bigint</type>
        </para>
        <para>
-        Number of transactions spilled to disk after the memory used by
-        logical decoding of changes from WAL for this slot exceeds
+        Number of transactions spilled to disk because the memory used by
+        logical decoding of changes from WAL for this slot exceeded
         <literal>logical_decoding_work_mem</literal>. The counter gets
-        incremented both for toplevel transactions and subtransactions.
+        incremented for both toplevel transactions and subtransactions.
       </para></entry>
      </row>
 
@@ -2613,8 +2613,8 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
        </para>
        <para>
         Number of times transactions were spilled to disk while decoding changes
-        from WAL for this slot. Transactions may get spilled repeatedly, and
-        this counter gets incremented on every such invocation.
+        from WAL for this slot. A given transaction may be spilled multiple times, and
+        this counter is incremented each time.
       </para></entry>
      </row>
 
@@ -2636,10 +2636,10 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
        </para>
        <para>
         Number of in-progress transactions streamed to the decoding output plugin
-        after the memory used by logical decoding of changes from WAL for this
-        slot exceeds <literal>logical_decoding_work_mem</literal>. Streaming only
+        because the memory used by logical decoding of changes from WAL for this
+        slot exceeded <literal>logical_decoding_work_mem</literal>. Streaming only
         works with toplevel transactions (subtransactions can't be streamed
-        independently), so the counter does not get incremented for subtransactions.
+        independently), so the counter is not incremented for subtransactions.
        </para></entry>
      </row>
 
@@ -2650,8 +2650,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
        <para>
         Number of times in-progress transactions were streamed to the decoding
         output plugin while decoding changes from WAL for this slot. Transactions
-        may get streamed repeatedly, and this counter gets incremented on every
-        such invocation.
+        may be streamed multiple times, and this counter is incremented each time.
       </para></entry>
      </row>
 
@@ -4970,10 +4969,10 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
        </para>
        <para>
          Resets statistics to zero for a single replication slot, or for all
-         replication slots in the cluster.  The argument can be either the name
-         of the slot to reset the stats or NULL.  If the argument is NULL, all
-         counters shown in the <structname>pg_stat_replication_slots</structname>
-         view for all replication slots are reset.
+         replication slots in the cluster.  The argument can be either NULL or the name
+         of a slot for which stats are to be reset.  If the argument is NULL, all
+         counters in the <structname>pg_stat_replication_slots</structname>
+         view are reset for all replication slots.
        </para>
        <para>
          This function is restricted to superusers by default, but other users
-- 
2.17.0

#4Magnus Hagander
magnus@hagander.net
In reply to: Justin Pryzby (#3)
Re: doc review for v14

On Sun, Dec 27, 2020 at 9:26 PM Justin Pryzby <pryzby@telsasoft.com> wrote:

On Thu, Dec 24, 2020 at 05:12:02PM +0900, Michael Paquier wrote:

0001-pgindent-typos.not-a-patch touches pg_bsd_indent.

I'm hoping that someone will apply it there, but I realize that access to
its
repository is tightly controlled :)

Not as much "tightly controlled" as "nobody's really bothered to grant any
permissions".

I've applied the patch, thanks! While at it I fixed the indentation of the
"target" row in the patch, I think you didn't take the fix all the way :)

You may also want to submit those fixes upstream in freebsd? The typos seem
to be present at
https://github.com/freebsd/freebsd/tree/master/usr.bin/indent as well. (If
so, please include the updated version that I applied, so we don't diverge
on that)

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/&gt;
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/&gt;

#5Michael Paquier
michael@paquier.xyz
In reply to: Magnus Hagander (#4)
Re: doc review for v14

On Mon, Dec 28, 2020 at 11:42:03AM +0100, Magnus Hagander wrote:

Not as much "tightly controlled" as "nobody's really bothered to grant any
permissions".

Magnus, do I have an access to that? This is the second time I am
crossing an issue with this issue, but I don't really know if I should
act on it or not :)
--
Michael

#6Thomas Munro
thomas.munro@gmail.com
In reply to: Michael Paquier (#2)
Re: doc review for v14

On Thu, Dec 24, 2020 at 9:12 PM Michael Paquier <michael@paquier.xyz> wrote:

On Mon, Dec 21, 2020 at 10:11:53PM -0600, Justin Pryzby wrote:

Specifies the amount of memory that should be allocated at server
-        startup time for use by parallel queries.  When this memory region is
+        startup for use by parallel queries.  When this memory region is
insufficient or exhausted by concurrent queries, new parallel queries
try to allocate extra shared memory temporarily from the operating
system using the method configured with
<varname>dynamic_shared_memory_type</varname>, which may be slower due
to memory management overheads.  Memory that is allocated at startup
-        time with <varname>min_dynamic_shared_memory</varname> is affected by
+        with <varname>min_dynamic_shared_memory</varname> is affected by
the <varname>huge_pages</varname> setting on operating systems where
that is supported, and may be more likely to benefit from larger pages
on operating systems where that is managed automatically.

The current formulation is not that confusing, but I agree that this
is an improvement. Thomas, you are behind this one. What do you
think?

LGTM.

#7Michael Paquier
michael@paquier.xyz
In reply to: Thomas Munro (#6)
Re: doc review for v14

On Tue, Dec 29, 2020 at 01:59:58PM +1300, Thomas Munro wrote:

LGTM.

Thanks, I have done this one then.
--
Michael

#8Michael Paquier
michael@paquier.xyz
In reply to: Justin Pryzby (#3)
Re: doc review for v14

On Sun, Dec 27, 2020 at 02:26:05PM -0600, Justin Pryzby wrote:

I think a couple of these should be backpatched.
doc/src/sgml/ref/pg_dump.sgml

This part can go down to 9.5.

doc/src/sgml/sources.sgml

Yes, I have done an extra effort on those fixes where needed. On top
of that, I have included catalogs.sgml, pgstatstatements.sgml,
explain.sgml, pg_verifybackup.sgml and wal.sgml in 13.

doc/src/sgml/cube.sgml?
doc/src/sgml/func.sgml?

These two are some beautification for the format of the function, so I
have left them out.
--
Michael

#9Magnus Hagander
magnus@hagander.net
In reply to: Michael Paquier (#5)
Re: doc review for v14

On Tue, Dec 29, 2020 at 1:37 AM Michael Paquier <michael@paquier.xyz> wrote:

On Mon, Dec 28, 2020 at 11:42:03AM +0100, Magnus Hagander wrote:

Not as much "tightly controlled" as "nobody's really bothered to grant

any

permissions".

Magnus, do I have an access to that? This is the second time I am
crossing an issue with this issue, but I don't really know if I should
act on it or not :)

No, at this point it's just Tom (who has all the commits) and me (who set
it up, and now has one commit). It's all manually handled.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/&gt;
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/&gt;

#10Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#9)
Re: doc review for v14

Magnus Hagander <magnus@hagander.net> writes:

On Tue, Dec 29, 2020 at 1:37 AM Michael Paquier <michael@paquier.xyz> wrote:

Magnus, do I have an access to that? This is the second time I am
crossing an issue with this issue, but I don't really know if I should
act on it or not :)

No, at this point it's just Tom (who has all the commits) and me (who set
it up, and now has one commit). It's all manually handled.

FTR, I have no objection to Michael (or any other PG committer) having
write access to that repo. I think so far it's a matter of nobody's
bothered because there's so little need.

regards, tom lane

#11Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#8)
Re: doc review for v14

On Tue, Dec 29, 2020 at 06:22:43PM +0900, Michael Paquier wrote:

Yes, I have done an extra effort on those fixes where needed. On top
of that, I have included catalogs.sgml, pgstatstatements.sgml,
explain.sgml, pg_verifybackup.sgml and wal.sgml in 13.

Justin, I got to look at the libxml2 part, and finished by rewording
the comment block as follows:
+    * XmlTable returns a table-set of composite values.  This error context
+    * is used for providing more details, and needs to be reset between two
+    * internal calls of libxml2 as different error contexts might have been
+    * created or used.

What do you think?
--
Michael

#12Justin Pryzby
pryzby@telsasoft.com
In reply to: Michael Paquier (#11)
Re: doc review for v14

On Sun, Jan 03, 2021 at 03:10:54PM +0900, Michael Paquier wrote:

On Tue, Dec 29, 2020 at 06:22:43PM +0900, Michael Paquier wrote:

Yes, I have done an extra effort on those fixes where needed. On top
of that, I have included catalogs.sgml, pgstatstatements.sgml,
explain.sgml, pg_verifybackup.sgml and wal.sgml in 13.

Justin, I got to look at the libxml2 part, and finished by rewording
the comment block as follows:
+    * XmlTable returns a table-set of composite values.  This error context
+    * is used for providing more details, and needs to be reset between two
+    * internal calls of libxml2 as different error contexts might have been
+    * created or used.

I don't like "this error context", since "this" seems to be referring to the
"tableset of composite values" as an err context.

I guess you mean: "needs to be reset between each internal call to libxml2.."

So I'd suggest:

+    * XmlTable returns a table-set of composite values.  The error context
+    * is used for providing additional detail. It needs to be reset between each
+    * call to libxml2, since different error contexts might have been
+    * created or used since it was last set.

But actually, maybe we should just use the comment that exists everywhere else
for that.

/* Propagate context related error context to libxml2 */
xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler);

Maybe should elaborate and say:
/*
* Propagate context related error context to libxml2 (needs to be
* reset before each call, in case other error contexts have been assigned since
* it was first set) */
*/
xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler);

--
Justin

#13Michael Paquier
michael@paquier.xyz
In reply to: Justin Pryzby (#12)
Re: doc review for v14

On Sun, Jan 03, 2021 at 12:33:54AM -0600, Justin Pryzby wrote:

But actually, maybe we should just use the comment that exists everywhere else
for that.

/* Propagate context related error context to libxml2 */
xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler);

I quite like your suggestion to be a maximum simple here, and the docs
of upstream also give a lot of context:
http://xmlsoft.org/html/libxml-xmlerror.html#xmlSetStructuredErrorFunc

So let's use this version and call it a day for this part.
--
Michael

#14Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#13)
Re: doc review for v14

On Sun, Jan 03, 2021 at 09:05:09PM +0900, Michael Paquier wrote:

So let's use this version and call it a day for this part.

This has been done as of b49154b.
--
Michael

#15Masahiko Sawada
sawada.mshk@gmail.com
In reply to: Michael Paquier (#14)
Re: doc review for v14

On Wed, Jan 6, 2021 at 10:37 AM Michael Paquier <michael@paquier.xyz> wrote:

On Sun, Jan 03, 2021 at 09:05:09PM +0900, Michael Paquier wrote:

So let's use this version and call it a day for this part.

This has been done as of b49154b.

It seems to me that all work has been done. Can we mark this patch
entry as "Committed"? Or waiting for something on the author?

Regards,

--
Masahiko Sawada
EDB: https://www.enterprisedb.com/

#16Michael Paquier
michael@paquier.xyz
In reply to: Masahiko Sawada (#15)
Re: doc review for v14

On Fri, Jan 22, 2021 at 09:53:13PM +0900, Masahiko Sawada wrote:

It seems to me that all work has been done. Can we mark this patch
entry as "Committed"? Or waiting for something on the author?

Patch 0005 posted on [1]/messages/by-id/20201227202604.GC26311@telsasoft.com -- Michael, related to some docs of replication slots,
still needs a lookup.

[1]: /messages/by-id/20201227202604.GC26311@telsasoft.com -- Michael
--
Michael

#17Michael Paquier
michael@paquier.xyz
In reply to: Justin Pryzby (#3)
Re: doc review for v14

Hi Justin,

On Sun, Dec 27, 2020 at 02:26:05PM -0600, Justin Pryzby wrote:

Thank you.

I have been looking at 0005, the patch dealing with the docs of the
replication stats, and have some comments.

        <para>
         Number of times transactions were spilled to disk while decoding changes
-        from WAL for this slot. Transactions may get spilled repeatedly, and
-        this counter gets incremented on every such invocation.
+        from WAL for this slot. A given transaction may be spilled multiple times, and
+        this counter is incremented each time.
       </para></entry>
The original can be a bit hard to read, and I don't think that the new
formulation is an improvement.  I actually find confusing that this
mixes in the same sentence that a transaction can be spilled multiple
times and increment this counter each time.  What about splitting that
into two sentences?  Here is an idea:
"This counter is incremented each time a transaction is spilled.  The
same transaction may be spilled multiple times."
-        Number of transactions spilled to disk after the memory used by
-        logical decoding of changes from WAL for this slot exceeds
+        Number of transactions spilled to disk because the memory used by
+        logical decoding of changes from WAL for this slot exceeded
What does "logical decoding of changes from WAL" mean?  Here is an
idea to clarify all that:
"Number of transactions spilled to disk once the memory used by
logical decoding to decode changes from WAL has exceeded
logical_decoding_work_mem."
         Number of in-progress transactions streamed to the decoding output plugin
-        after the memory used by logical decoding of changes from WAL for this
-        slot exceeds <literal>logical_decoding_work_mem</literal>. Streaming only
+        because the memory used by logical decoding of changes from WAL for this
+        slot exceeded <literal>logical_decoding_work_mem</literal>. Streaming only
         works with toplevel transactions (subtransactions can't be streamed
-        independently), so the counter does not get incremented for subtransactions+        independently), so the counter is not incremented for subtransactions.
I have the same issue here with "by logical decoding of changes from
WAL".  I'd say "after the memory used by logical decoding to decode
changes from WAL for this slot has exceeded logical_decoding_work_mem".
         output plugin while decoding changes from WAL for this slot. Transactions
-        may get streamed repeatedly, and this counter gets incremented on every
-        such invocation.
+        may be streamed multiple times, and this counter is incremented each time.
I would split this stuff into two sentences:
"This counter is incremented each time a transaction is streamed.  The
same transaction may be streamed multiple times.
          Resets statistics to zero for a single replication slot, or for all
-         replication slots in the cluster.  The argument can be either the name
-         of the slot to reset the stats or NULL.  If the argument is NULL, all
-         counters shown in the <structname>pg_stat_replication_slots</structname>
-         view for all replication slots are reset.
+         replication slots in the cluster.  The argument can be either NULL or the name
+         of a slot for which stats are to be reset.  If the argument is NULL, all
+         counters in the <structname>pg_stat_replication_slots</structname>
+         view are reset for all replication slots.
Here also, I find rather confusing that this paragraph tells multiple
times that NULL resets the stats for all the replication slots.  NULL
should use a <literal> markup, and it is cleaner to use "statistics"
rather than "stats" IMO.  So I guess we could simplify things as
follows:
"Resets statistics of the replication slot defined by the argument. If
the argument is NULL, resets statistics for all the replication
slots."
--
Michael
#18Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#17)
1 attachment(s)
Re: doc review for v14

On Sat, Jan 23, 2021 at 07:15:40PM +0900, Michael Paquier wrote:

I have been looking at 0005, the patch dealing with the docs of the
replication stats, and have some comments.

And attached is a patch to clarify all that. I am letting that sleep
for a couple of days for now, so please let me know if you have any
comments.
--
Michael

Attachments:

replslot-docs.patchtext/x-diff; charset=us-asciiDownload
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 9496f76b1f..c602ee4427 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -317,7 +317,7 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
      <row>
       <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
       <entry>One row per replication slot, showing statistics about
-       replication slot usage.
+       the replication slot's usage.
        See <link linkend="monitoring-pg-stat-replication-slots-view">
        <structname>pg_stat_replication_slots</structname></link> for details.
       </entry>
@@ -2604,10 +2604,10 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
         <structfield>spill_txns</structfield> <type>bigint</type>
        </para>
        <para>
-        Number of transactions spilled to disk after the memory used by
-        logical decoding of changes from WAL for this slot exceeds
+        Number of transactions spilled to disk once the memory used by
+        logical decoding to decode changes from WAL has exceeded
         <literal>logical_decoding_work_mem</literal>. The counter gets
-        incremented both for toplevel transactions and subtransactions.
+        incremented for both toplevel transactions and subtransactions.
       </para></entry>
      </row>
 
@@ -2616,9 +2616,10 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
         <structfield>spill_count</structfield> <type>bigint</type>
        </para>
        <para>
-        Number of times transactions were spilled to disk while decoding changes
-        from WAL for this slot. Transactions may get spilled repeatedly, and
-        this counter gets incremented on every such invocation.
+        Number of times transactions were spilled to disk while decoding
+        changes from WAL for this slot. This counter is incremented each time
+        a transaction is spilled, and the same transaction may be spilled
+        multiple times.
       </para></entry>
      </row>
 
@@ -2639,11 +2640,12 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
         <structfield>stream_txns</structfield> <type>bigint</type>
        </para>
        <para>
-        Number of in-progress transactions streamed to the decoding output plugin
-        after the memory used by logical decoding of changes from WAL for this
-        slot exceeds <literal>logical_decoding_work_mem</literal>. Streaming only
+        Number of in-progress transactions streamed to the decoding output
+        plugin after the memory used by logical decoding to decode changes
+        from WAL for this slot has exceeded
+        <literal>logical_decoding_work_mem</literal>. Streaming only
         works with toplevel transactions (subtransactions can't be streamed
-        independently), so the counter does not get incremented for subtransactions.
+        independently), so the counter is not incremented for subtransactions.
        </para></entry>
      </row>
 
@@ -2653,9 +2655,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
        </para>
        <para>
         Number of times in-progress transactions were streamed to the decoding
-        output plugin while decoding changes from WAL for this slot. Transactions
-        may get streamed repeatedly, and this counter gets incremented on every
-        such invocation.
+        output plugin while decoding changes from WAL for this slot. This
+        counter is incremented each time a transaction is streamed, and the
+        same transaction may be streamed multiple times.
       </para></entry>
      </row>
 
@@ -5042,7 +5044,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
       </row>
 
       <row>
-        <entry role="func_table_entry"><para role="func_signature">
+       <entry role="func_table_entry"><para role="func_signature">
         <indexterm>
           <primary>pg_stat_reset_replication_slot</primary>
         </indexterm>
@@ -5050,11 +5052,9 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
         <returnvalue>void</returnvalue>
        </para>
        <para>
-         Resets statistics to zero for a single replication slot, or for all
-         replication slots in the cluster.  The argument can be either the name
-         of the slot to reset the stats or NULL.  If the argument is NULL, all
-         counters shown in the <structname>pg_stat_replication_slots</structname>
-         view for all replication slots are reset.
+        Resets statistics of the replication slot defined by the argument. If
+        the argument is <literal>NULL</literal>, resets statistics for all
+        the replication slots.
        </para>
        <para>
          This function is restricted to superusers by default, but other users
#19Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#18)
Re: doc review for v14

On Wed, Jan 27, 2021 at 02:52:14PM +0900, Michael Paquier wrote:

And attached is a patch to clarify all that. I am letting that sleep
for a couple of days for now, so please let me know if you have any
comments.

I have spent some time on that, and applied this stuff as of 2a5862f
after some extra tweaks. As there is nothing left, this CF entry is
now closed.
--
Michael

#20Justin Pryzby
pryzby@telsasoft.com
In reply to: Michael Paquier (#19)
18 attachment(s)
Re: doc review for v14

Another round of doc fixen.

wdiff to follow

commit 389c4ac2febe21fd48480a86819d94fd2eb9c1cc
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed Feb 10 17:19:51 2021 -0600

doc review for pg_stat_progress_create_index

ab0dfc961b6a821f23d9c40c723d11380ce195a6

should backpatch to v13

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index c602ee4427..16eb1d9e9c 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -5725,7 +5725,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
      </para>
      <para>
       When creating an index on a partitioned table, this column is set to
       the number of partitions on which the index has been [-completed.-]{+created.+}
      </para></entry>
     </row>
    </tbody>

commit bff6f0b557ff79365fc21d0ae261bad0fcb96539
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat Feb 6 15:17:51 2021 -0600

*an old and "deleted [has] happened"

Heikki missed this in 6b387179baab8d0e5da6570678eefbe61f3acc79

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 3763b4b995..a51f2c9920 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -6928,8 +6928,8 @@ Delete
</term>
<listitem>
<para>
                Identifies the following TupleData message as [-a-]{+an+} old tuple.
                This field is present if the table in which the delete[-has-]
                happened has REPLICA IDENTITY set to FULL.
</para>
</listitem>

commit 9bd601fa82ceeaf09573ce31eb3c081b4ae7a45d
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat Jan 23 21:03:37 2021 -0600

doc review for logical decoding of prepared xacts

0aa8a01d04c8fe200b7a106878eebc3d0af9105c

diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index b854f2ccfc..71e9f36b8e 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -791,9 +791,9 @@ typedef void (*LogicalDecodeMessageCB) (struct LogicalDecodingContext *ctx,
     <para>
       The optional <function>filter_prepare_cb</function> callback
       is called to determine whether data that is part of the current
       two-phase commit transaction should be considered for [-decode-]{+decoding+}
       at this prepare stage or {+later+} as a regular one-phase transaction at
       <command>COMMIT PREPARED</command> [-time later.-]{+time.+} To signal that
       decoding should be skipped, return <literal>true</literal>;
       <literal>false</literal> otherwise. When the callback is not
       defined, <literal>false</literal> is assumed (i.e. nothing is
@@ -820,11 +820,11 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx
      The required <function>begin_prepare_cb</function> callback is called
      whenever the start of a prepared transaction has been decoded. The
      <parameter>gid</parameter> field, which is part of the
      <parameter>txn</parameter> [-parameter-]{+parameter,+} can be used in this callback to
      check if the plugin has already received this [-prepare-]{+PREPARE+} in which case it
      can skip the remaining changes of the transaction. This can only happen
      if the user restarts the decoding after receiving the [-prepare-]{+PREPARE+} for a
      transaction but before receiving the [-commit prepared-]{+COMMIT PREPARED,+} say because of some
      error.
      <programlisting>
       typedef void (*LogicalDecodeBeginPrepareCB) (struct LogicalDecodingContext *ctx,
@@ -842,7 +842,7 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx
      decoded. The <function>change_cb</function> callback for all modified
      rows will have been called before this, if there have been any modified
      rows. The <parameter>gid</parameter> field, which is part of the
      <parameter>txn</parameter> [-parameter-]{+parameter,+} can be used in this callback.
      <programlisting>
       typedef void (*LogicalDecodePrepareCB) (struct LogicalDecodingContext *ctx,
                                               ReorderBufferTXN *txn,
@@ -856,9 +856,9 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx

<para>
The required <function>commit_prepared_cb</function> callback is called
whenever a transaction [-commit prepared-]{+COMMIT PREPARED+} has been decoded. The
<parameter>gid</parameter> field, which is part of the
<parameter>txn</parameter> [-parameter-]{+parameter,+} can be used in this callback.
<programlisting>
typedef void (*LogicalDecodeCommitPreparedCB) (struct LogicalDecodingContext *ctx,
ReorderBufferTXN *txn,
@@ -872,15 +872,15 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx

<para>
The required <function>rollback_prepared_cb</function> callback is called
whenever a transaction [-rollback prepared-]{+ROLLBACK PREPARED+} has been decoded. The
<parameter>gid</parameter> field, which is part of the
<parameter>txn</parameter> [-parameter-]{+parameter,+} can be used in this callback. The
parameters <parameter>prepare_end_lsn</parameter> and
<parameter>prepare_time</parameter> can be used to check if the plugin
has received this [-prepare transaction-]{+PREPARE TRANSACTION+} in which case it can apply the
rollback, otherwise, it can skip the rollback operation. The
<parameter>gid</parameter> alone is not sufficient because the downstream
node can have {+a+} prepared transaction with same identifier.
<programlisting>
typedef void (*LogicalDecodeRollbackPreparedCB) (struct LogicalDecodingContext *ctx,
ReorderBufferTXN *txn,
@@ -1122,7 +1122,7 @@ OutputPluginWrite(ctx, true);
the <function>stream_commit_cb</function> callback
(or possibly aborted using the <function>stream_abort_cb</function> callback).
If two-phase commits are supported, the transaction can be prepared using the
<function>stream_prepare_cb</function> callback, [-commit prepared-]{+COMMIT PREPARED+} using the
<function>commit_prepared_cb</function> callback or aborted using the
<function>rollback_prepared_cb</function>.
</para>

commit 7ddf562c7b384b4a802111ac1b0eab3698982c8e
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat Jan 23 21:02:47 2021 -0600

doc review for multiranges

6df7a9698bb036610c1e8c6d375e1be38cb26d5f

diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml
index 6e3d82b85b..ec95b4eb01 100644
--- a/doc/src/sgml/extend.sgml
+++ b/doc/src/sgml/extend.sgml
@@ -448,7 +448,7 @@
     of <type>anycompatible</type> and <type>anycompatiblenonarray</type>
     inputs, the array element types of <type>anycompatiblearray</type>
     inputs, the range subtypes of <type>anycompatiblerange</type> inputs,
     and the multirange subtypes of [-<type>anycompatiablemultirange</type>-]{+<type>anycompatiblemultirange</type>+}
     inputs.  If <type>anycompatiblenonarray</type> is present then the
     common type is required to be a non-array type.  Once a common type is
     identified, arguments in <type>anycompatible</type>

commit 4fa1fd9769c93dbec71fa92097ebfea5f420bb09
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat Jan 23 20:33:10 2021 -0600

doc review: logical decode in prepare

a271a1b50e9bec07e2ef3a05e38e7285113e4ce6

diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index cf705ed9cd..b854f2ccfc 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -1214,7 +1214,7 @@ stream_commit_cb(...);  &lt;-- commit of the streamed transaction
   </para>

<para>
When a prepared transaction is [-rollbacked-]{+rolled back+} using the
<command>ROLLBACK PREPARED</command>, then the
<function>rollback_prepared_cb</function> callback is invoked and when the
prepared transaction is committed using <command>COMMIT PREPARED</command>,

commit d27a74968b61354ad1186a4740063dd4ac0b1bea
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat Jan 23 17:17:58 2021 -0600

doc review for FDW bulk inserts

b663a4136331de6c7364226e3dbf7c88bfee7145

diff --git a/doc/src/sgml/fdwhandler.sgml b/doc/src/sgml/fdwhandler.sgml
index 854913ae5f..12e00bfc2f 100644
--- a/doc/src/sgml/fdwhandler.sgml
+++ b/doc/src/sgml/fdwhandler.sgml
@@ -672,9 +672,8 @@ GetForeignModifyBatchSize(ResultRelInfo *rinfo);

Report the maximum number of tuples that a single
<function>ExecForeignBatchInsert</function> call can handle for
the specified foreign table.[-That is,-] The executor passes at most
the {+given+} number of tuples[-that this function returns-] to <function>ExecForeignBatchInsert</function>.
<literal>rinfo</literal> is the <structname>ResultRelInfo</structname> struct describing
the target foreign table.
The FDW is expected to provide a foreign server and/or foreign

commit 2b8fdcc91562045b6b2cec0e69a724e078cfbdb5
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed Feb 3 00:51:25 2021 -0600

doc review: piecemeal construction of partitioned indexes

5efd604ec0a3bdde98fe19d8cada69ab4ef80db3

backpatch to v11

diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 1e9a4625cc..a8cbd45d35 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3962,8 +3962,8 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02
     As explained above, it is possible to create indexes on partitioned tables
     so that they are applied automatically to the entire hierarchy.
     This is very
     convenient, as not only[-will-] the existing partitions [-become-]{+will be+} indexed, but
     [-also-]{+so will+} any partitions that are created in the [-future will.-]{+future.+}  One limitation is
     that it's not possible to use the <literal>CONCURRENTLY</literal>
     qualifier when creating such a partitioned index.  To avoid long lock
     times, it is possible to use <command>CREATE INDEX ON ONLY</command>

commit 2f6d8a4d0157b632ad1e0ff3b0a54c4d38199637
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat Jan 30 18:10:21 2021 -0600

duplicate words

commit 9c4f5192f69ed16c99e0d079f0b5faebd7bad212
Allow pg_rewind to use a standby server as the source system.

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
Add tests for tuplesort.c.

commit 0a2bc5d61e713e3fe72438f020eea5fcc90b0f0b
Move per-agg and per-trans duplicate finding to the planner.

commit 623a9ba79bbdd11c5eccb30b8bd5c446130e521c
snapshot scalability: cache snapshots using a xact completion counter.

commit 2c03216d831160bedd72d45f712601b6f7d03f1c
Revamp the WAL record format.

diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c
index e723253297..25d6df1659 100644
--- a/src/backend/access/transam/xlogutils.c
+++ b/src/backend/access/transam/xlogutils.c
@@ -433,8 +433,7 @@ XLogReadBufferForRedoExtended(XLogReaderState *record,
 * NB: A redo function should normally not call this directly. To get a page
 * to modify, use XLogReadBufferForRedoExtended instead. It is important that
 * all pages modified by a WAL record are registered in the WAL records, or
 * they will be invisible to tools that[-that-] need to know which pages are[-*-] modified.
 */
Buffer
XLogReadBufferExtended(RelFileNode rnode, ForkNumber forknum,
diff --git a/src/backend/optimizer/prep/prepagg.c b/src/backend/optimizer/prep/prepagg.c
index 929a8ea13b..89046f9afb 100644
--- a/src/backend/optimizer/prep/prepagg.c
+++ b/src/backend/optimizer/prep/prepagg.c
@@ -71,7 +71,7 @@ static Datum GetAggInitVal(Datum textInitVal, Oid transtype);
 *
 * Information about the aggregates and transition functions are collected
 * in the root->agginfos and root->aggtransinfos lists.  The 'aggtranstype',
 * 'aggno', and 'aggtransno' fields [-in-]{+of each Aggref+} are filled [-in in each Aggref.-]{+in.+}
 *
 * NOTE: This modifies the Aggrefs in the input expression in-place!
 *
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index cf12eda504..b9fbdcb88f 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -2049,7 +2049,7 @@ GetSnapshotDataReuse(Snapshot snapshot)
	 * holding ProcArrayLock) exclusively). Thus the xactCompletionCount check
	 * ensures we would detect if the snapshot would have changed.
	 *
	 * As the snapshot contents are the same as it was before, it is[-is-] safe
	 * to re-enter the snapshot's xmin into the PGPROC array. None of the rows
	 * visible under the snapshot could already have been removed (that'd
	 * require the set of running transactions to change) and it fulfills the
diff --git a/src/bin/pg_rewind/libpq_source.c b/src/bin/pg_rewind/libpq_source.c
index 86d2adcaee..ac794cf4eb 100644
--- a/src/bin/pg_rewind/libpq_source.c
+++ b/src/bin/pg_rewind/libpq_source.c
@@ -539,7 +539,7 @@ process_queued_fetch_requests(libpq_source *src)
						 chunkoff, rq->path, (int64) rq->offset);
			/*
			 * We should not receive[-receive-] more data than we requested, or
			 * pg_read_binary_file() messed up.  We could receive less,
			 * though, if the file was truncated in the source after we
			 * checked its size. That's OK, there should be a WAL record of
diff --git a/src/test/regress/expected/tuplesort.out b/src/test/regress/expected/tuplesort.out
index 3fc1998bf2..418f296a3f 100644
--- a/src/test/regress/expected/tuplesort.out
+++ b/src/test/regress/expected/tuplesort.out
@@ -1,7 +1,7 @@
-- only use parallelism when explicitly intending to do so
SET max_parallel_maintenance_workers = 0;
SET max_parallel_workers = 0;
-- A table with[-with-] contents that, when sorted, triggers abbreviated
-- key aborts. One easy way to achieve that is to use uuids that all
-- have the same prefix, as abbreviated keys for uuids just use the
-- first sizeof(Datum) bytes.
diff --git a/src/test/regress/sql/tuplesort.sql b/src/test/regress/sql/tuplesort.sql
index 7d7e02f02a..846484d561 100644
--- a/src/test/regress/sql/tuplesort.sql
+++ b/src/test/regress/sql/tuplesort.sql
@@ -2,7 +2,7 @@
SET max_parallel_maintenance_workers = 0;
SET max_parallel_workers = 0;

-- A table with[-with-] contents that, when sorted, triggers abbreviated
-- key aborts. One easy way to achieve that is to use uuids that all
-- have the same prefix, as abbreviated keys for uuids just use the
-- first sizeof(Datum) bytes.

commit 4920f9520d7ba1b420bcf03ae48178d74425a622
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun Jan 17 10:57:21 2021 -0600

doc review for checksum docs

cf621d9d84db1e6edaff8ffa26bad93fdce5f830

diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml
index 66de1ee2f8..02f576a1a9 100644
--- a/doc/src/sgml/wal.sgml
+++ b/doc/src/sgml/wal.sgml
@@ -237,19 +237,19 @@
  </indexterm>

<para>
[-Data-]{+By default, data+} pages are not[-checksum-] protected by [-default,-]{+checksums,+} but this can optionally be
enabled for a cluster. When enabled, each data page will be [-assigned-]{+ASSIGNED+} a
checksum that is updated when the page is written and verified [-every-]{+each+} time
the page is read. Only data pages are protected by [-checksums,-]{+checksums;+} internal data
structures and temporary files are not.
</para>

<para>
Checksums [-are-]{+verification is+} normally [-enabled-]{+ENABLED+} when the cluster is initialized using <link
linkend="app-initdb-data-checksums"><application>initdb</application></link>.
They can also be enabled or disabled at a later time as an offline
operation. Data checksums are enabled or disabled at the full cluster
level, and cannot be specified[-individually-] for {+individual+} databases or tables.
</para>

<para>
@@ -260,9 +260,9 @@
</para>

<para>
When attempting to recover from corrupt [-data-]{+data,+} it may be necessary to bypass
the checksum [-protection in order to recover data.-]{+protection.+} To do this, temporarily set the configuration
parameter <xref linkend="guc-ignore-checksum-failure" />.
</para>

<sect2 id="checksums-offline-enable-disable">

commit fc69321a5ebc55cb1df9648bc28215672cffbf31
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed Jan 20 16:10:49 2021 -0600

Doc review for psql \dX

ad600bba0422dde4b73fbd61049ff2a3847b068a

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..d0f397d5ea 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1930,8 +1930,9 @@ testdb=&gt;
        </para>

<para>
The [-column-]{+status+} of [-the-]{+each+} kind of extended [-stats-]{+statistics is shown in a column+}
{+ named after the "kind"+} (e.g. [-Ndistinct) shows its status.-]{+Ndistinct).+}
NULL means that it doesn't [-exists.-]{+exist.+} "defined" means that it was requested
when creating the statistics.
You can use pg_stats_ext if you'd like to know whether <link linkend="sql-analyze">
<command>ANALYZE</command></link> was run and statistics are available to the

commit 78035a725e13e28bbae9e62fe7013bef435d70e3
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat Feb 6 15:13:37 2021 -0600

*an exclusive

3c84046490bed3c22e0873dc6ba492e02b8b9051

diff --git a/doc/src/sgml/ref/drop_index.sgml b/doc/src/sgml/ref/drop_index.sgml
index 85cf23bca2..b6d2c2014f 100644
--- a/doc/src/sgml/ref/drop_index.sgml
+++ b/doc/src/sgml/ref/drop_index.sgml
@@ -45,7 +45,7 @@ DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] <replaceable class="parameter">name</r
     <para>
      Drop the index without locking out concurrent selects, inserts, updates,
      and deletes on the index's table.  A normal <command>DROP INDEX</command>
      acquires {+an+} exclusive lock on the table, blocking other accesses until the
      index drop can be completed.  With this option, the command instead
      waits until conflicting transactions have completed.
     </para>

commit c36ac4c1f85f620ae9ce9cfa7c14b6c95dcdedc5
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed Dec 30 09:39:16 2020 -0600

function comment: get_am_name

diff --git a/src/backend/commands/amcmds.c b/src/backend/commands/amcmds.c
index eff9535ed0..188109e474 100644
--- a/src/backend/commands/amcmds.c
+++ b/src/backend/commands/amcmds.c
@@ -186,7 +186,7 @@ get_am_oid(const char *amname, bool missing_ok)
}

/*
* get_am_name - given an access method [-OID name and type,-]{+OID,+} look up its name.
*/
char *
get_am_name(Oid amOid)

commit 22e6f0e2d4eaf78e449393bf2bf8b3f8af2b71f8
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon Jan 18 14:37:17 2021 -0600

One fewer (not one less)

diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c
index 9abcee32af..f6760eb31e 100644
--- a/contrib/pageinspect/heapfuncs.c
+++ b/contrib/pageinspect/heapfuncs.c
@@ -338,7 +338,7 @@ tuple_data_split_internal(Oid relid, char *tupdata,
		attr = TupleDescAttr(tupdesc, i);
		/*
		 * Tuple header can specify [-less-]{+fewer+} attributes than tuple descriptor as
		 * ALTER TABLE ADD COLUMN without DEFAULT keyword does not actually
		 * change tuples in pages, so attributes with numbers greater than
		 * (t_infomask2 & HEAP_NATTS_MASK) should be treated as NULL.
diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml
index cebc09ef91..1b00e543a6 100644
--- a/doc/src/sgml/charset.sgml
+++ b/doc/src/sgml/charset.sgml
@@ -619,7 +619,7 @@ SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR";
    name such as <literal>de_DE</literal> can be considered unique
    within a given database even though it would not be unique globally.
    Use of the stripped collation names is recommended, since it will
    make one [-less-]{+fewer+} thing you need to change if you decide to change to
    another database encoding.  Note however that the <literal>default</literal>,
    <literal>C</literal>, and <literal>POSIX</literal> collations can be used regardless of
    the database encoding.
diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgml
index 0b24a55505..693423e524 100644
--- a/doc/src/sgml/ref/create_type.sgml
+++ b/doc/src/sgml/ref/create_type.sgml
@@ -867,7 +867,7 @@ CREATE TYPE <replaceable class="parameter">name</replaceable>
   Before <productname>PostgreSQL</productname> version 8.3, the name of
   a generated array type was always exactly the element type's name with one
   underscore character (<literal>_</literal>) prepended.  (Type names were
   therefore restricted in length to one [-less-]{+fewer+} character than other names.)
   While this is still usually the case, the array type name may vary from
   this in case of maximum-length names or collisions with user type names
   that begin with underscore.  Writing code that depends on this convention
diff --git a/doc/src/sgml/rules.sgml b/doc/src/sgml/rules.sgml
index e81addcfa9..aa172d102b 100644
--- a/doc/src/sgml/rules.sgml
+++ b/doc/src/sgml/rules.sgml
@@ -1266,7 +1266,7 @@ CREATE [ OR REPLACE ] RULE <replaceable class="parameter">name</replaceable> AS
<para>
    The query trees generated from rule actions are thrown into the
    rewrite system again, and maybe more rules get applied resulting
    in [-more-]{+additional+} or [-less-]{+fewer+} query trees.
    So a rule's actions must have either a different
    command type or a different result relation than the rule itself is
    on, otherwise this recursive process will end up in an infinite loop.
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index 24a27e387d..0b56b0fa5a 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -719,11 +719,11 @@ heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest)
}
/*
 * Expand a tuple which has [-less-]{+fewer+} attributes than required. For each attribute
 * not present in the sourceTuple, if there is a missing value that will be
 * used. Otherwise the attribute will be set to NULL.
 *
 * The source tuple must have [-less-]{+fewer+} attributes than the required number.
 *
 * Only one of targetHeapTuple and targetMinimalTuple may be supplied. The
 * other argument must be NULL.
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index 7295cf0215..64908ac39c 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -1003,7 +1003,7 @@ examine_attribute(Relation onerel, int attnum, Node *index_expr)
 * As of May 2004 we use a new two-stage method:  Stage one selects up
 * to targrows random blocks (or all blocks, if there aren't so many).
 * Stage two scans these blocks and uses the Vitter algorithm to create
 * a random sample of targrows rows (or [-less,-]{+fewer,+} if there are [-less-]{+fewer+} in the
 * sample of blocks).  The two stages are executed simultaneously: each
 * block is processed as soon as stage one returns its number and while
 * the rows are read stage two controls which ones are to be inserted
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 4d185c27b4..078aaef539 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -263,7 +263,7 @@ static int	compareDatetime(Datum val1, Oid typid1, Datum val2, Oid typid2,
 *		implement @? and @@ operators, which in turn are intended to have an
 *		index support.  Thus, it's desirable to make it easier to achieve
 *		consistency between index scan results and sequential scan results.
 *		So, we throw as [-less-]{+few+} errors as possible.  Regarding this function,
 *		such behavior also matches behavior of JSON_EXISTS() clause of
 *		SQL/JSON.  Regarding jsonb_path_match(), this function doesn't have
 *		an analogy in SQL/JSON, so we define its behavior on our own.
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 47ca4ddbb5..52314d3aa1 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -645,7 +645,7 @@ scalarineqsel(PlannerInfo *root, Oid operator, bool isgt, bool iseq,
			/*
			 * The calculation so far gave us a selectivity for the "<=" case.
			 * We'll have one [-less-]{+fewer+} tuple for "<" and one additional tuple for
			 * ">=", the latter of which we'll reverse the selectivity for
			 * below, so we can simply subtract one tuple for both cases.  The
			 * cases that need this adjustment can be identified by iseq being
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index fa2b49c676..55c9445898 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -1497,7 +1497,7 @@ GetCatCacheHashValue(CatCache *cache,
 *		It doesn't make any sense to specify all of the cache's key columns
 *		here: since the key is unique, there could be at most one match, so
 *		you ought to use SearchCatCache() instead.  Hence this function takes
 *		one [-less-]{+fewer+} Datum argument than SearchCatCache() does.
 *
 *		The caller must not modify the list object or the pointed-to tuples,
 *		and must call ReleaseCatCacheList() when done with the list.
diff --git a/src/backend/utils/misc/sampling.c b/src/backend/utils/misc/sampling.c
index 0c327e823f..7348b86682 100644
--- a/src/backend/utils/misc/sampling.c
+++ b/src/backend/utils/misc/sampling.c
@@ -42,7 +42,7 @@ BlockSampler_Init(BlockSampler bs, BlockNumber nblocks, int samplesize,
	bs->N = nblocks;			/* measured table size */
	/*
	 * If we decide to reduce samplesize for tables that have [-less-]{+fewer+} or not much
	 * more than samplesize blocks, here is the place to do it.
	 */
	bs->n = samplesize;
diff --git a/src/backend/utils/mmgr/freepage.c b/src/backend/utils/mmgr/freepage.c
index e4ee1aab97..10a1effb74 100644
--- a/src/backend/utils/mmgr/freepage.c
+++ b/src/backend/utils/mmgr/freepage.c
@@ -495,7 +495,7 @@ FreePageManagerDump(FreePageManager *fpm)
 * if we search the parent page for the first key greater than or equal to
 * the first key on the current page, the downlink to this page will be either
 * the exact index returned by the search (if the first key decreased)
 * or one [-less-]{+fewer+} (if the first key increased).
 */
static void
FreePageBtreeAdjustAncestorKeys(FreePageManager *fpm, FreePageBtree *btp)
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index a4a3f40048..627a244fb7 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -6458,7 +6458,7 @@ threadRun(void *arg)
			/*
			 * If advanceConnectionState changed client to finished state,
			 * that's one [-less-]{+fewer+} client that remains.
			 */
			if (st->state == CSTATE_FINISHED || st->state == CSTATE_ABORTED)
				remains--;
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index d27c8601fa..e3d2e751ea 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -21,7 +21,7 @@

/*
* Maximum length for identifiers (e.g. table names, column names,
* function names). Names actually are limited to one [-less-]{+fewer+} byte than this,
* because the length must include a trailing zero byte.
*
* Changing this requires an initdb.
@@ -87,7 +87,7 @@

/*
 * MAXPGPATH: standard size of a pathname buffer in PostgreSQL (hence,
 * maximum usable pathname length is one [-less).-]{+fewer).+}
 *
 * We'd use a standard system header symbol for this, if there weren't
 * so many to choose from: MAXPATHLEN, MAX_PATH, PATH_MAX are all
diff --git a/src/interfaces/ecpg/include/sqlda-native.h b/src/interfaces/ecpg/include/sqlda-native.h
index 67d3c7b4e4..9e73f1f1b1 100644
--- a/src/interfaces/ecpg/include/sqlda-native.h
+++ b/src/interfaces/ecpg/include/sqlda-native.h
@@ -7,7 +7,7 @@
/*
 * Maximum length for identifiers (e.g. table names, column names,
 * function names).  Names actually are limited to one [-less-]{+fewer+} byte than this,
 * because the length must include a trailing zero byte.
 *
 * This should be at least as much as NAMEDATALEN of the database the
diff --git a/src/test/regress/expected/geometry.out b/src/test/regress/expected/geometry.out
index 84f7eabb66..9799cfbdbd 100644
--- a/src/test/regress/expected/geometry.out
+++ b/src/test/regress/expected/geometry.out
@@ -4325,7 +4325,7 @@ SELECT f1, polygon(8, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';
 <(100,1),115>  | ((-15,1),(18.6827201635,82.3172798365),(100,116),(181.317279836,82.3172798365),(215,1),(181.317279836,-80.3172798365),(100,-114),(18.6827201635,-80.3172798365))
(6 rows)
-- Too [-less-]{+few+} points error
SELECT f1, polygon(1, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';
ERROR:  must request at least 2 points
-- Zero radius error
diff --git a/src/test/regress/sql/geometry.sql b/src/test/regress/sql/geometry.sql
index 96df0ab05a..b0ab6d03ec 100644
--- a/src/test/regress/sql/geometry.sql
+++ b/src/test/regress/sql/geometry.sql
@@ -424,7 +424,7 @@ SELECT f1, f1::polygon FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';
-- To polygon with less points
SELECT f1, polygon(8, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';

-- Too [-less-]{+few+} points error
SELECT f1, polygon(1, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';

-- Zero radius error

commit 1c00249319faf6dc23aadf4568ead5adc65ff57f
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed Feb 10 17:45:07 2021 -0600

comment typos

diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
		uint32		curoptimal;
		SH_ELEMENT_TYPE *entry = &data[curelem];

/* any empty bucket can[-directly-] be used {+directly+} */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;

commit 2ac95b66e30785d480ef04c11d12b1075548045e
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat Nov 14 23:09:21 2020 -0600

typos in master

diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 7c341c8e3f..fe88c2273a 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -639,7 +639,7 @@ NUMERIC

<para>
The <literal>NaN</literal> (not a number) value is used to represent
undefined [-calculational-]{+computational+} results. In general, any operation with
a <literal>NaN</literal> input yields another <literal>NaN</literal>.
The only exception is when the operation's other inputs are such that
the same output would be obtained if the <literal>NaN</literal> were to

commit d6d3499f52e664b7da88a3f2c94701cae6d76609
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat Dec 5 22:43:12 2020 -0600

pg_restore: "must be specified" and --list

This was discussed here, but the idea got lost.
/messages/by-id/20190612170201.GA11881@alvherre.pgsql

diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index 589b4aed53..f6e6e41329 100644
--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -305,7 +305,7 @@ main(int argc, char **argv)
	/* Complain if neither -f nor -d was specified (except if dumping TOC) */
	if (!opts->cparams.dbname && !opts->filename && !opts->tocSummary)
	{
		pg_log_error("one of [--d/--dbname and -f/--file-]{+-d/--dbname, -f/--file, or -l/--list+} must be specified");
		exit_nicely(1);
	}
diff --git a/src/bin/pg_dump/t/001_basic.pl b/src/bin/pg_dump/t/001_basic.pl
index 083fb3ad08..8280914c2a 100644
--- a/src/bin/pg_dump/t/001_basic.pl
+++ b/src/bin/pg_dump/t/001_basic.pl
@@ -63,8 +63,8 @@ command_fails_like(

command_fails_like(
['pg_restore'],
qr{\Qpg_restore: error: one of [--d/--dbname and -f/--file-]{+-d/--dbname, -f/--file, or -l/--list+} must be specified\E},
'pg_restore: error: one of [--d/--dbname and -f/--file-]{+-d/--dbname, -f/--file, or -l/--list+} must be specified');

command_fails_like(
[ 'pg_restore', '-s', '-a', '-f -' ],

commit 7c2dee70b0450bac5cfa2c3db52b4a2b2e535a9e
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat Feb 15 15:53:34 2020 -0600

Update comment obsolete since 69c3936a

diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 601b6dab03..394b4e667b 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -2064,8 +2064,7 @@ initialize_hash_entry(AggState *aggstate, TupleHashTable hashtable,
}

/*
* Look up hash entries for the current tuple in all hashed grouping [-sets,-]
[- * returning an array of pergroup pointers suitable for advance_aggregates.-]{+sets.+}
*
* Be aware that lookup_hash_entry can reset the tmpcontext.
*

commit 4b81f9512395cb321730e0a3dba1c659b9c2fee3
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri Jan 8 13:09:55 2021 -0600

doc: pageinspect

d6061f83a166b015657fda8623c704fcb86930e9

backpatch to 9.6?

diff --git a/doc/src/sgml/pageinspect.sgml b/doc/src/sgml/pageinspect.sgml
index a0be779940..a7bce41b7c 100644
--- a/doc/src/sgml/pageinspect.sgml
+++ b/doc/src/sgml/pageinspect.sgml
@@ -211,7 +211,7 @@ test=# SELECT tuple_data_split('pg_class'::regclass, t_data, t_infomask, t_infom
     </para>
     <para>
      If <parameter>do_detoast</parameter> is <literal>true</literal>,
      [-attribute that-]{+attributes+} will be detoasted as needed. Default value is
      <literal>false</literal>.
     </para>
    </listitem>

Attachments:

0001-doc-pageinspect.patchtext/x-diff; charset=us-asciiDownload
From 4b81f9512395cb321730e0a3dba1c659b9c2fee3 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 8 Jan 2021 13:09:55 -0600
Subject: [PATCH 01/18] doc: pageinspect

d6061f83a166b015657fda8623c704fcb86930e9

backpatch to 9.6?
---
 doc/src/sgml/pageinspect.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/pageinspect.sgml b/doc/src/sgml/pageinspect.sgml
index a0be779940..a7bce41b7c 100644
--- a/doc/src/sgml/pageinspect.sgml
+++ b/doc/src/sgml/pageinspect.sgml
@@ -211,7 +211,7 @@ test=# SELECT tuple_data_split('pg_class'::regclass, t_data, t_infomask, t_infom
      </para>
      <para>
       If <parameter>do_detoast</parameter> is <literal>true</literal>,
-      attribute that will be detoasted as needed. Default value is
+      attributes will be detoasted as needed. Default value is
       <literal>false</literal>.
      </para>
     </listitem>
-- 
2.17.0

0002-Update-comment-obsolete-since-69c3936a.patchtext/x-diff; charset=us-asciiDownload
From 7c2dee70b0450bac5cfa2c3db52b4a2b2e535a9e Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 15 Feb 2020 15:53:34 -0600
Subject: [PATCH 02/18] Update comment obsolete since 69c3936a

---
 src/backend/executor/nodeAgg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 601b6dab03..394b4e667b 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -2064,8 +2064,7 @@ initialize_hash_entry(AggState *aggstate, TupleHashTable hashtable,
 }
 
 /*
- * Look up hash entries for the current tuple in all hashed grouping sets,
- * returning an array of pergroup pointers suitable for advance_aggregates.
+ * Look up hash entries for the current tuple in all hashed grouping sets.
  *
  * Be aware that lookup_hash_entry can reset the tmpcontext.
  *
-- 
2.17.0

0003-pg_restore-must-be-specified-and-list.patchtext/x-diff; charset=us-asciiDownload
From d6d3499f52e664b7da88a3f2c94701cae6d76609 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Dec 2020 22:43:12 -0600
Subject: [PATCH 03/18] pg_restore: "must be specified" and --list

This was discussed here, but the idea got lost.
https://www.postgresql.org/message-id/flat/20190612170201.GA11881%40alvherre.pgsql#2984347ab074e6f198bd294fa41884df
---
 src/bin/pg_dump/pg_restore.c   | 2 +-
 src/bin/pg_dump/t/001_basic.pl | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index 589b4aed53..f6e6e41329 100644
--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -305,7 +305,7 @@ main(int argc, char **argv)
 	/* Complain if neither -f nor -d was specified (except if dumping TOC) */
 	if (!opts->cparams.dbname && !opts->filename && !opts->tocSummary)
 	{
-		pg_log_error("one of -d/--dbname and -f/--file must be specified");
+		pg_log_error("one of -d/--dbname, -f/--file, or -l/--list must be specified");
 		exit_nicely(1);
 	}
 
diff --git a/src/bin/pg_dump/t/001_basic.pl b/src/bin/pg_dump/t/001_basic.pl
index 083fb3ad08..8280914c2a 100644
--- a/src/bin/pg_dump/t/001_basic.pl
+++ b/src/bin/pg_dump/t/001_basic.pl
@@ -63,8 +63,8 @@ command_fails_like(
 
 command_fails_like(
 	['pg_restore'],
-	qr{\Qpg_restore: error: one of -d/--dbname and -f/--file must be specified\E},
-	'pg_restore: error: one of -d/--dbname and -f/--file must be specified');
+	qr{\Qpg_restore: error: one of -d/--dbname, -f/--file, or -l/--list must be specified\E},
+	'pg_restore: error: one of -d/--dbname, -f/--file, or -l/--list must be specified');
 
 command_fails_like(
 	[ 'pg_restore', '-s', '-a', '-f -' ],
-- 
2.17.0

0004-typos-in-master.patchtext/x-diff; charset=us-asciiDownload
From 2ac95b66e30785d480ef04c11d12b1075548045e Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 14 Nov 2020 23:09:21 -0600
Subject: [PATCH 04/18] typos in master

---
 doc/src/sgml/datatype.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 7c341c8e3f..fe88c2273a 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -639,7 +639,7 @@ NUMERIC
 
     <para>
      The <literal>NaN</literal> (not a number) value is used to represent
-     undefined calculational results.  In general, any operation with
+     undefined computational results.  In general, any operation with
      a <literal>NaN</literal> input yields another <literal>NaN</literal>.
      The only exception is when the operation's other inputs are such that
      the same output would be obtained if the <literal>NaN</literal> were to
-- 
2.17.0

0005-comment-typos.patchtext/x-diff; charset=us-asciiDownload
From 1c00249319faf6dc23aadf4568ead5adc65ff57f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 10 Feb 2021 17:45:07 -0600
Subject: [PATCH 05/18] comment typos

---
 src/include/lib/simplehash.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
 		uint32		curoptimal;
 		SH_ELEMENT_TYPE *entry = &data[curelem];
 
-		/* any empty bucket can directly be used */
+		/* any empty bucket can be used directly */
 		if (entry->status == SH_STATUS_EMPTY)
 		{
 			tb->members++;
-- 
2.17.0

0006-One-fewer-not-one-less.patchtext/x-diff; charset=us-asciiDownload
From 22e6f0e2d4eaf78e449393bf2bf8b3f8af2b71f8 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 18 Jan 2021 14:37:17 -0600
Subject: [PATCH 06/18] One fewer (not one less)

---
 contrib/pageinspect/heapfuncs.c            | 2 +-
 doc/src/sgml/charset.sgml                  | 2 +-
 doc/src/sgml/ref/create_type.sgml          | 2 +-
 doc/src/sgml/rules.sgml                    | 2 +-
 src/backend/access/common/heaptuple.c      | 4 ++--
 src/backend/commands/analyze.c             | 2 +-
 src/backend/utils/adt/jsonpath_exec.c      | 2 +-
 src/backend/utils/adt/selfuncs.c           | 2 +-
 src/backend/utils/cache/catcache.c         | 2 +-
 src/backend/utils/misc/sampling.c          | 2 +-
 src/backend/utils/mmgr/freepage.c          | 2 +-
 src/bin/pgbench/pgbench.c                  | 2 +-
 src/include/pg_config_manual.h             | 4 ++--
 src/interfaces/ecpg/include/sqlda-native.h | 2 +-
 src/test/regress/expected/geometry.out     | 2 +-
 src/test/regress/sql/geometry.sql          | 2 +-
 16 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c
index 9abcee32af..f6760eb31e 100644
--- a/contrib/pageinspect/heapfuncs.c
+++ b/contrib/pageinspect/heapfuncs.c
@@ -338,7 +338,7 @@ tuple_data_split_internal(Oid relid, char *tupdata,
 		attr = TupleDescAttr(tupdesc, i);
 
 		/*
-		 * Tuple header can specify less attributes than tuple descriptor as
+		 * Tuple header can specify fewer attributes than tuple descriptor as
 		 * ALTER TABLE ADD COLUMN without DEFAULT keyword does not actually
 		 * change tuples in pages, so attributes with numbers greater than
 		 * (t_infomask2 & HEAP_NATTS_MASK) should be treated as NULL.
diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml
index cebc09ef91..1b00e543a6 100644
--- a/doc/src/sgml/charset.sgml
+++ b/doc/src/sgml/charset.sgml
@@ -619,7 +619,7 @@ SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR";
     name such as <literal>de_DE</literal> can be considered unique
     within a given database even though it would not be unique globally.
     Use of the stripped collation names is recommended, since it will
-    make one less thing you need to change if you decide to change to
+    make one fewer thing you need to change if you decide to change to
     another database encoding.  Note however that the <literal>default</literal>,
     <literal>C</literal>, and <literal>POSIX</literal> collations can be used regardless of
     the database encoding.
diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgml
index 0b24a55505..693423e524 100644
--- a/doc/src/sgml/ref/create_type.sgml
+++ b/doc/src/sgml/ref/create_type.sgml
@@ -867,7 +867,7 @@ CREATE TYPE <replaceable class="parameter">name</replaceable>
    Before <productname>PostgreSQL</productname> version 8.3, the name of
    a generated array type was always exactly the element type's name with one
    underscore character (<literal>_</literal>) prepended.  (Type names were
-   therefore restricted in length to one less character than other names.)
+   therefore restricted in length to one fewer character than other names.)
    While this is still usually the case, the array type name may vary from
    this in case of maximum-length names or collisions with user type names
    that begin with underscore.  Writing code that depends on this convention
diff --git a/doc/src/sgml/rules.sgml b/doc/src/sgml/rules.sgml
index e81addcfa9..aa172d102b 100644
--- a/doc/src/sgml/rules.sgml
+++ b/doc/src/sgml/rules.sgml
@@ -1266,7 +1266,7 @@ CREATE [ OR REPLACE ] RULE <replaceable class="parameter">name</replaceable> AS
 <para>
     The query trees generated from rule actions are thrown into the
     rewrite system again, and maybe more rules get applied resulting
-    in more or less query trees.
+    in additional or fewer query trees.
     So a rule's actions must have either a different
     command type or a different result relation than the rule itself is
     on, otherwise this recursive process will end up in an infinite loop.
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index 24a27e387d..0b56b0fa5a 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -719,11 +719,11 @@ heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest)
 }
 
 /*
- * Expand a tuple which has less attributes than required. For each attribute
+ * Expand a tuple which has fewer attributes than required. For each attribute
  * not present in the sourceTuple, if there is a missing value that will be
  * used. Otherwise the attribute will be set to NULL.
  *
- * The source tuple must have less attributes than the required number.
+ * The source tuple must have fewer attributes than the required number.
  *
  * Only one of targetHeapTuple and targetMinimalTuple may be supplied. The
  * other argument must be NULL.
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index 7295cf0215..64908ac39c 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -1003,7 +1003,7 @@ examine_attribute(Relation onerel, int attnum, Node *index_expr)
  * As of May 2004 we use a new two-stage method:  Stage one selects up
  * to targrows random blocks (or all blocks, if there aren't so many).
  * Stage two scans these blocks and uses the Vitter algorithm to create
- * a random sample of targrows rows (or less, if there are less in the
+ * a random sample of targrows rows (or fewer, if there are fewer in the
  * sample of blocks).  The two stages are executed simultaneously: each
  * block is processed as soon as stage one returns its number and while
  * the rows are read stage two controls which ones are to be inserted
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 4d185c27b4..078aaef539 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -263,7 +263,7 @@ static int	compareDatetime(Datum val1, Oid typid1, Datum val2, Oid typid2,
  *		implement @? and @@ operators, which in turn are intended to have an
  *		index support.  Thus, it's desirable to make it easier to achieve
  *		consistency between index scan results and sequential scan results.
- *		So, we throw as less errors as possible.  Regarding this function,
+ *		So, we throw as few errors as possible.  Regarding this function,
  *		such behavior also matches behavior of JSON_EXISTS() clause of
  *		SQL/JSON.  Regarding jsonb_path_match(), this function doesn't have
  *		an analogy in SQL/JSON, so we define its behavior on our own.
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 47ca4ddbb5..52314d3aa1 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -645,7 +645,7 @@ scalarineqsel(PlannerInfo *root, Oid operator, bool isgt, bool iseq,
 
 			/*
 			 * The calculation so far gave us a selectivity for the "<=" case.
-			 * We'll have one less tuple for "<" and one additional tuple for
+			 * We'll have one fewer tuple for "<" and one additional tuple for
 			 * ">=", the latter of which we'll reverse the selectivity for
 			 * below, so we can simply subtract one tuple for both cases.  The
 			 * cases that need this adjustment can be identified by iseq being
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index fa2b49c676..55c9445898 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -1497,7 +1497,7 @@ GetCatCacheHashValue(CatCache *cache,
  *		It doesn't make any sense to specify all of the cache's key columns
  *		here: since the key is unique, there could be at most one match, so
  *		you ought to use SearchCatCache() instead.  Hence this function takes
- *		one less Datum argument than SearchCatCache() does.
+ *		one fewer Datum argument than SearchCatCache() does.
  *
  *		The caller must not modify the list object or the pointed-to tuples,
  *		and must call ReleaseCatCacheList() when done with the list.
diff --git a/src/backend/utils/misc/sampling.c b/src/backend/utils/misc/sampling.c
index 0c327e823f..7348b86682 100644
--- a/src/backend/utils/misc/sampling.c
+++ b/src/backend/utils/misc/sampling.c
@@ -42,7 +42,7 @@ BlockSampler_Init(BlockSampler bs, BlockNumber nblocks, int samplesize,
 	bs->N = nblocks;			/* measured table size */
 
 	/*
-	 * If we decide to reduce samplesize for tables that have less or not much
+	 * If we decide to reduce samplesize for tables that have fewer or not much
 	 * more than samplesize blocks, here is the place to do it.
 	 */
 	bs->n = samplesize;
diff --git a/src/backend/utils/mmgr/freepage.c b/src/backend/utils/mmgr/freepage.c
index e4ee1aab97..10a1effb74 100644
--- a/src/backend/utils/mmgr/freepage.c
+++ b/src/backend/utils/mmgr/freepage.c
@@ -495,7 +495,7 @@ FreePageManagerDump(FreePageManager *fpm)
  * if we search the parent page for the first key greater than or equal to
  * the first key on the current page, the downlink to this page will be either
  * the exact index returned by the search (if the first key decreased)
- * or one less (if the first key increased).
+ * or one fewer (if the first key increased).
  */
 static void
 FreePageBtreeAdjustAncestorKeys(FreePageManager *fpm, FreePageBtree *btp)
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index a4a3f40048..627a244fb7 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -6458,7 +6458,7 @@ threadRun(void *arg)
 
 			/*
 			 * If advanceConnectionState changed client to finished state,
-			 * that's one less client that remains.
+			 * that's one fewer client that remains.
 			 */
 			if (st->state == CSTATE_FINISHED || st->state == CSTATE_ABORTED)
 				remains--;
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index d27c8601fa..e3d2e751ea 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -21,7 +21,7 @@
 
 /*
  * Maximum length for identifiers (e.g. table names, column names,
- * function names).  Names actually are limited to one less byte than this,
+ * function names).  Names actually are limited to one fewer byte than this,
  * because the length must include a trailing zero byte.
  *
  * Changing this requires an initdb.
@@ -87,7 +87,7 @@
 
 /*
  * MAXPGPATH: standard size of a pathname buffer in PostgreSQL (hence,
- * maximum usable pathname length is one less).
+ * maximum usable pathname length is one fewer).
  *
  * We'd use a standard system header symbol for this, if there weren't
  * so many to choose from: MAXPATHLEN, MAX_PATH, PATH_MAX are all
diff --git a/src/interfaces/ecpg/include/sqlda-native.h b/src/interfaces/ecpg/include/sqlda-native.h
index 67d3c7b4e4..9e73f1f1b1 100644
--- a/src/interfaces/ecpg/include/sqlda-native.h
+++ b/src/interfaces/ecpg/include/sqlda-native.h
@@ -7,7 +7,7 @@
 
 /*
  * Maximum length for identifiers (e.g. table names, column names,
- * function names).  Names actually are limited to one less byte than this,
+ * function names).  Names actually are limited to one fewer byte than this,
  * because the length must include a trailing zero byte.
  *
  * This should be at least as much as NAMEDATALEN of the database the
diff --git a/src/test/regress/expected/geometry.out b/src/test/regress/expected/geometry.out
index 84f7eabb66..9799cfbdbd 100644
--- a/src/test/regress/expected/geometry.out
+++ b/src/test/regress/expected/geometry.out
@@ -4325,7 +4325,7 @@ SELECT f1, polygon(8, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';
  <(100,1),115>  | ((-15,1),(18.6827201635,82.3172798365),(100,116),(181.317279836,82.3172798365),(215,1),(181.317279836,-80.3172798365),(100,-114),(18.6827201635,-80.3172798365))
 (6 rows)
 
--- Too less points error
+-- Too few points error
 SELECT f1, polygon(1, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';
 ERROR:  must request at least 2 points
 -- Zero radius error
diff --git a/src/test/regress/sql/geometry.sql b/src/test/regress/sql/geometry.sql
index 96df0ab05a..b0ab6d03ec 100644
--- a/src/test/regress/sql/geometry.sql
+++ b/src/test/regress/sql/geometry.sql
@@ -424,7 +424,7 @@ SELECT f1, f1::polygon FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';
 -- To polygon with less points
 SELECT f1, polygon(8, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';
 
--- Too less points error
+-- Too few points error
 SELECT f1, polygon(1, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';
 
 -- Zero radius error
-- 
2.17.0

0007-function-comment-get_am_name.patchtext/x-diff; charset=us-asciiDownload
From c36ac4c1f85f620ae9ce9cfa7c14b6c95dcdedc5 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 30 Dec 2020 09:39:16 -0600
Subject: [PATCH 07/18] function comment: get_am_name

---
 src/backend/commands/amcmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/commands/amcmds.c b/src/backend/commands/amcmds.c
index eff9535ed0..188109e474 100644
--- a/src/backend/commands/amcmds.c
+++ b/src/backend/commands/amcmds.c
@@ -186,7 +186,7 @@ get_am_oid(const char *amname, bool missing_ok)
 }
 
 /*
- * get_am_name - given an access method OID name and type, look up its name.
+ * get_am_name - given an access method OID, look up its name.
  */
 char *
 get_am_name(Oid amOid)
-- 
2.17.0

0008-an-exclusive.patchtext/x-diff; charset=us-asciiDownload
From 78035a725e13e28bbae9e62fe7013bef435d70e3 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 6 Feb 2021 15:13:37 -0600
Subject: [PATCH 08/18] *an exclusive

3c84046490bed3c22e0873dc6ba492e02b8b9051
---
 doc/src/sgml/ref/drop_index.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/drop_index.sgml b/doc/src/sgml/ref/drop_index.sgml
index 85cf23bca2..b6d2c2014f 100644
--- a/doc/src/sgml/ref/drop_index.sgml
+++ b/doc/src/sgml/ref/drop_index.sgml
@@ -45,7 +45,7 @@ DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] <replaceable class="parameter">name</r
      <para>
       Drop the index without locking out concurrent selects, inserts, updates,
       and deletes on the index's table.  A normal <command>DROP INDEX</command>
-      acquires exclusive lock on the table, blocking other accesses until the
+      acquires an exclusive lock on the table, blocking other accesses until the
       index drop can be completed.  With this option, the command instead
       waits until conflicting transactions have completed.
      </para>
-- 
2.17.0

0009-Doc-review-for-psql-dX.patchtext/x-diff; charset=us-asciiDownload
From fc69321a5ebc55cb1df9648bc28215672cffbf31 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 20 Jan 2021 16:10:49 -0600
Subject: [PATCH 09/18] Doc review for psql \dX

ad600bba0422dde4b73fbd61049ff2a3847b068a
---
 doc/src/sgml/ref/psql-ref.sgml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..d0f397d5ea 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1930,8 +1930,9 @@ testdb=&gt;
         </para>
 
         <para>
-        The column of the kind of extended stats (e.g. Ndistinct) shows its status.
-        NULL means that it doesn't exists. "defined" means that it was requested
+        The status of each kind of extended statistics is shown in a column
+        named after the "kind" (e.g. Ndistinct).
+        NULL means that it doesn't exist. "defined" means that it was requested
         when creating the statistics.
         You can use pg_stats_ext if you'd like to know whether <link linkend="sql-analyze">
         <command>ANALYZE</command></link> was run and statistics are available to the
-- 
2.17.0

0010-doc-review-for-checksum-docs.patchtext/x-diff; charset=us-asciiDownload
From 4920f9520d7ba1b420bcf03ae48178d74425a622 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 17 Jan 2021 10:57:21 -0600
Subject: [PATCH 10/18] doc review for checksum docs

cf621d9d84db1e6edaff8ffa26bad93fdce5f830
---
 doc/src/sgml/wal.sgml | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml
index 66de1ee2f8..02f576a1a9 100644
--- a/doc/src/sgml/wal.sgml
+++ b/doc/src/sgml/wal.sgml
@@ -237,19 +237,19 @@
   </indexterm>
 
   <para>
-   Data pages are not checksum protected by default, but this can optionally be
-   enabled for a cluster.  When enabled, each data page will be assigned a
-   checksum that is updated when the page is written and verified every time
-   the page is read. Only data pages are protected by checksums, internal data
+   By default, data pages are not protected by checksums, but this can optionally be
+   enabled for a cluster.  When enabled, each data page will be ASSIGNED a
+   checksum that is updated when the page is written and verified each time
+   the page is read. Only data pages are protected by checksums; internal data
    structures and temporary files are not.
   </para>
 
   <para>
-   Checksums are normally enabled when the cluster is initialized using <link
+   Checksums verification is normally ENABLED when the cluster is initialized using <link
    linkend="app-initdb-data-checksums"><application>initdb</application></link>.
    They can also be enabled or disabled at a later time as an offline
    operation. Data checksums are enabled or disabled at the full cluster
-   level, and cannot be specified individually for databases or tables.
+   level, and cannot be specified for individual databases or tables.
   </para>
 
   <para>
@@ -260,9 +260,9 @@
   </para>
 
   <para>
-   When attempting to recover from corrupt data it may be necessary to bypass
-   the checksum protection in order to recover data. To do this, temporarily
-   set the configuration parameter <xref linkend="guc-ignore-checksum-failure" />.
+   When attempting to recover from corrupt data, it may be necessary to bypass
+   the checksum protection. To do this, temporarily set the configuration
+   parameter <xref linkend="guc-ignore-checksum-failure" />.
   </para>
 
   <sect2 id="checksums-offline-enable-disable">
-- 
2.17.0

0011-duplicate-words.patchtext/x-diff; charset=us-asciiDownload
From 2f6d8a4d0157b632ad1e0ff3b0a54c4d38199637 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 30 Jan 2021 18:10:21 -0600
Subject: [PATCH 11/18] duplicate words

commit 9c4f5192f69ed16c99e0d079f0b5faebd7bad212
    Allow pg_rewind to use a standby server as the source system.

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

commit 0a2bc5d61e713e3fe72438f020eea5fcc90b0f0b
    Move per-agg and per-trans duplicate finding to the planner.

commit 623a9ba79bbdd11c5eccb30b8bd5c446130e521c
    snapshot scalability: cache snapshots using a xact completion counter.

commit 2c03216d831160bedd72d45f712601b6f7d03f1c
    Revamp the WAL record format.
---
 src/backend/access/transam/xlogutils.c  | 3 +--
 src/backend/optimizer/prep/prepagg.c    | 2 +-
 src/backend/storage/ipc/procarray.c     | 2 +-
 src/bin/pg_rewind/libpq_source.c        | 2 +-
 src/test/regress/expected/tuplesort.out | 2 +-
 src/test/regress/sql/tuplesort.sql      | 2 +-
 6 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c
index e723253297..25d6df1659 100644
--- a/src/backend/access/transam/xlogutils.c
+++ b/src/backend/access/transam/xlogutils.c
@@ -433,8 +433,7 @@ XLogReadBufferForRedoExtended(XLogReaderState *record,
  * NB: A redo function should normally not call this directly. To get a page
  * to modify, use XLogReadBufferForRedoExtended instead. It is important that
  * all pages modified by a WAL record are registered in the WAL records, or
- * they will be invisible to tools that that need to know which pages are
- * modified.
+ * they will be invisible to tools that need to know which pages are modified.
  */
 Buffer
 XLogReadBufferExtended(RelFileNode rnode, ForkNumber forknum,
diff --git a/src/backend/optimizer/prep/prepagg.c b/src/backend/optimizer/prep/prepagg.c
index 929a8ea13b..89046f9afb 100644
--- a/src/backend/optimizer/prep/prepagg.c
+++ b/src/backend/optimizer/prep/prepagg.c
@@ -71,7 +71,7 @@ static Datum GetAggInitVal(Datum textInitVal, Oid transtype);
  *
  * Information about the aggregates and transition functions are collected
  * in the root->agginfos and root->aggtransinfos lists.  The 'aggtranstype',
- * 'aggno', and 'aggtransno' fields in are filled in in each Aggref.
+ * 'aggno', and 'aggtransno' fields of each Aggref are filled in.
  *
  * NOTE: This modifies the Aggrefs in the input expression in-place!
  *
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index cf12eda504..b9fbdcb88f 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -2049,7 +2049,7 @@ GetSnapshotDataReuse(Snapshot snapshot)
 	 * holding ProcArrayLock) exclusively). Thus the xactCompletionCount check
 	 * ensures we would detect if the snapshot would have changed.
 	 *
-	 * As the snapshot contents are the same as it was before, it is is safe
+	 * As the snapshot contents are the same as it was before, it is safe
 	 * to re-enter the snapshot's xmin into the PGPROC array. None of the rows
 	 * visible under the snapshot could already have been removed (that'd
 	 * require the set of running transactions to change) and it fulfills the
diff --git a/src/bin/pg_rewind/libpq_source.c b/src/bin/pg_rewind/libpq_source.c
index 86d2adcaee..ac794cf4eb 100644
--- a/src/bin/pg_rewind/libpq_source.c
+++ b/src/bin/pg_rewind/libpq_source.c
@@ -539,7 +539,7 @@ process_queued_fetch_requests(libpq_source *src)
 						 chunkoff, rq->path, (int64) rq->offset);
 
 			/*
-			 * We should not receive receive more data than we requested, or
+			 * We should not receive more data than we requested, or
 			 * pg_read_binary_file() messed up.  We could receive less,
 			 * though, if the file was truncated in the source after we
 			 * checked its size. That's OK, there should be a WAL record of
diff --git a/src/test/regress/expected/tuplesort.out b/src/test/regress/expected/tuplesort.out
index 3fc1998bf2..418f296a3f 100644
--- a/src/test/regress/expected/tuplesort.out
+++ b/src/test/regress/expected/tuplesort.out
@@ -1,7 +1,7 @@
 -- only use parallelism when explicitly intending to do so
 SET max_parallel_maintenance_workers = 0;
 SET max_parallel_workers = 0;
--- A table with with contents that, when sorted, triggers abbreviated
+-- A table with contents that, when sorted, triggers abbreviated
 -- key aborts. One easy way to achieve that is to use uuids that all
 -- have the same prefix, as abbreviated keys for uuids just use the
 -- first sizeof(Datum) bytes.
diff --git a/src/test/regress/sql/tuplesort.sql b/src/test/regress/sql/tuplesort.sql
index 7d7e02f02a..846484d561 100644
--- a/src/test/regress/sql/tuplesort.sql
+++ b/src/test/regress/sql/tuplesort.sql
@@ -2,7 +2,7 @@
 SET max_parallel_maintenance_workers = 0;
 SET max_parallel_workers = 0;
 
--- A table with with contents that, when sorted, triggers abbreviated
+-- A table with contents that, when sorted, triggers abbreviated
 -- key aborts. One easy way to achieve that is to use uuids that all
 -- have the same prefix, as abbreviated keys for uuids just use the
 -- first sizeof(Datum) bytes.
-- 
2.17.0

0012-doc-review-piecemeal-construction-of-partitioned-ind.patchtext/x-diff; charset=us-asciiDownload
From 2b8fdcc91562045b6b2cec0e69a724e078cfbdb5 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 3 Feb 2021 00:51:25 -0600
Subject: [PATCH 12/18] doc review: piecemeal construction of partitioned
 indexes

5efd604ec0a3bdde98fe19d8cada69ab4ef80db3

backpatch to v11
---
 doc/src/sgml/ddl.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 1e9a4625cc..a8cbd45d35 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3962,8 +3962,8 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02
      As explained above, it is possible to create indexes on partitioned tables
      so that they are applied automatically to the entire hierarchy.
      This is very
-     convenient, as not only will the existing partitions become indexed, but
-     also any partitions that are created in the future will.  One limitation is
+     convenient, as not only the existing partitions will be indexed, but
+     so will any partitions that are created in the future.  One limitation is
      that it's not possible to use the <literal>CONCURRENTLY</literal>
      qualifier when creating such a partitioned index.  To avoid long lock
      times, it is possible to use <command>CREATE INDEX ON ONLY</command>
-- 
2.17.0

0013-doc-review-for-FDW-bulk-inserts.patchtext/x-diff; charset=us-asciiDownload
From d27a74968b61354ad1186a4740063dd4ac0b1bea Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 23 Jan 2021 17:17:58 -0600
Subject: [PATCH 13/18] doc review for FDW bulk inserts

b663a4136331de6c7364226e3dbf7c88bfee7145
---
 doc/src/sgml/fdwhandler.sgml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/fdwhandler.sgml b/doc/src/sgml/fdwhandler.sgml
index 854913ae5f..12e00bfc2f 100644
--- a/doc/src/sgml/fdwhandler.sgml
+++ b/doc/src/sgml/fdwhandler.sgml
@@ -672,9 +672,8 @@ GetForeignModifyBatchSize(ResultRelInfo *rinfo);
 
      Report the maximum number of tuples that a single
      <function>ExecForeignBatchInsert</function> call can handle for
-     the specified foreign table.  That is, The executor passes at most
-     the number of tuples that this function returns to
-     <function>ExecForeignBatchInsert</function>.
+     the specified foreign table.  The executor passes at most
+     the given number of tuples to <function>ExecForeignBatchInsert</function>.
      <literal>rinfo</literal> is the <structname>ResultRelInfo</structname> struct describing
      the target foreign table.
      The FDW is expected to provide a foreign server and/or foreign
-- 
2.17.0

0014-doc-review-logical-decode-in-prepare.patchtext/x-diff; charset=us-asciiDownload
From 4fa1fd9769c93dbec71fa92097ebfea5f420bb09 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 23 Jan 2021 20:33:10 -0600
Subject: [PATCH 14/18] doc review: logical decode in prepare

a271a1b50e9bec07e2ef3a05e38e7285113e4ce6
---
 doc/src/sgml/logicaldecoding.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index cf705ed9cd..b854f2ccfc 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -1214,7 +1214,7 @@ stream_commit_cb(...);  &lt;-- commit of the streamed transaction
    </para>
 
    <para>
-    When a prepared transaction is rollbacked using the
+    When a prepared transaction is rolled back using the
     <command>ROLLBACK PREPARED</command>, then the
     <function>rollback_prepared_cb</function> callback is invoked and when the
     prepared transaction is committed using <command>COMMIT PREPARED</command>,
-- 
2.17.0

0015-doc-review-for-multiranges.patchtext/x-diff; charset=us-asciiDownload
From 7ddf562c7b384b4a802111ac1b0eab3698982c8e Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 23 Jan 2021 21:02:47 -0600
Subject: [PATCH 15/18] doc review for multiranges

6df7a9698bb036610c1e8c6d375e1be38cb26d5f
---
 doc/src/sgml/extend.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml
index 6e3d82b85b..ec95b4eb01 100644
--- a/doc/src/sgml/extend.sgml
+++ b/doc/src/sgml/extend.sgml
@@ -448,7 +448,7 @@
      of <type>anycompatible</type> and <type>anycompatiblenonarray</type>
      inputs, the array element types of <type>anycompatiblearray</type>
      inputs, the range subtypes of <type>anycompatiblerange</type> inputs,
-     and the multirange subtypes of <type>anycompatiablemultirange</type>
+     and the multirange subtypes of <type>anycompatiblemultirange</type>
      inputs.  If <type>anycompatiblenonarray</type> is present then the
      common type is required to be a non-array type.  Once a common type is
      identified, arguments in <type>anycompatible</type>
-- 
2.17.0

0016-doc-review-for-logical-decoding-of-prepared-xacts.patchtext/x-diff; charset=us-asciiDownload
From 9bd601fa82ceeaf09573ce31eb3c081b4ae7a45d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 23 Jan 2021 21:03:37 -0600
Subject: [PATCH 16/18] doc review for logical decoding of prepared xacts

0aa8a01d04c8fe200b7a106878eebc3d0af9105c
---
 doc/src/sgml/logicaldecoding.sgml | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index b854f2ccfc..71e9f36b8e 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -791,9 +791,9 @@ typedef void (*LogicalDecodeMessageCB) (struct LogicalDecodingContext *ctx,
      <para>
        The optional <function>filter_prepare_cb</function> callback
        is called to determine whether data that is part of the current
-       two-phase commit transaction should be considered for decode
-       at this prepare stage or as a regular one-phase transaction at
-       <command>COMMIT PREPARED</command> time later. To signal that
+       two-phase commit transaction should be considered for decoding
+       at this prepare stage or later as a regular one-phase transaction at
+       <command>COMMIT PREPARED</command> time. To signal that
        decoding should be skipped, return <literal>true</literal>;
        <literal>false</literal> otherwise. When the callback is not
        defined, <literal>false</literal> is assumed (i.e. nothing is
@@ -820,11 +820,11 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx
       The required <function>begin_prepare_cb</function> callback is called
       whenever the start of a prepared transaction has been decoded. The
       <parameter>gid</parameter> field, which is part of the
-      <parameter>txn</parameter> parameter can be used in this callback to
-      check if the plugin has already received this prepare in which case it
+      <parameter>txn</parameter> parameter, can be used in this callback to
+      check if the plugin has already received this PREPARE in which case it
       can skip the remaining changes of the transaction. This can only happen
-      if the user restarts the decoding after receiving the prepare for a
-      transaction but before receiving the commit prepared say because of some
+      if the user restarts the decoding after receiving the PREPARE for a
+      transaction but before receiving the COMMIT PREPARED, say because of some
       error.
       <programlisting>
        typedef void (*LogicalDecodeBeginPrepareCB) (struct LogicalDecodingContext *ctx,
@@ -842,7 +842,7 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx
       decoded. The <function>change_cb</function> callback for all modified
       rows will have been called before this, if there have been any modified
       rows. The <parameter>gid</parameter> field, which is part of the
-      <parameter>txn</parameter> parameter can be used in this callback.
+      <parameter>txn</parameter> parameter, can be used in this callback.
       <programlisting>
        typedef void (*LogicalDecodePrepareCB) (struct LogicalDecodingContext *ctx,
                                                ReorderBufferTXN *txn,
@@ -856,9 +856,9 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx
 
      <para>
       The required <function>commit_prepared_cb</function> callback is called
-      whenever a transaction commit prepared has been decoded. The
+      whenever a transaction COMMIT PREPARED has been decoded. The
       <parameter>gid</parameter> field, which is part of the
-      <parameter>txn</parameter> parameter can be used in this callback.
+      <parameter>txn</parameter> parameter, can be used in this callback.
       <programlisting>
        typedef void (*LogicalDecodeCommitPreparedCB) (struct LogicalDecodingContext *ctx,
                                                       ReorderBufferTXN *txn,
@@ -872,15 +872,15 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx
 
      <para>
       The required <function>rollback_prepared_cb</function> callback is called
-      whenever a transaction rollback prepared has been decoded. The
+      whenever a transaction ROLLBACK PREPARED has been decoded. The
       <parameter>gid</parameter> field, which is part of the
-      <parameter>txn</parameter> parameter can be used in this callback. The
+      <parameter>txn</parameter> parameter, can be used in this callback. The
       parameters <parameter>prepare_end_lsn</parameter> and
       <parameter>prepare_time</parameter> can be used to check if the plugin
-      has received this prepare transaction in which case it can apply the
+      has received this PREPARE TRANSACTION in which case it can apply the
       rollback, otherwise, it can skip the rollback operation. The
       <parameter>gid</parameter> alone is not sufficient because the downstream
-      node can have prepared transaction with same identifier.
+      node can have a prepared transaction with same identifier.
       <programlisting>
        typedef void (*LogicalDecodeRollbackPreparedCB) (struct LogicalDecodingContext *ctx,
                                                         ReorderBufferTXN *txn,
@@ -1122,7 +1122,7 @@ OutputPluginWrite(ctx, true);
     the <function>stream_commit_cb</function> callback
     (or possibly aborted using the <function>stream_abort_cb</function> callback).
     If two-phase commits are supported, the transaction can be prepared using the
-    <function>stream_prepare_cb</function> callback, commit prepared using the
+    <function>stream_prepare_cb</function> callback, COMMIT PREPARED using the
     <function>commit_prepared_cb</function> callback or aborted using the
     <function>rollback_prepared_cb</function>.
    </para>
-- 
2.17.0

0017-an-old-and-deleted-has-happened.patchtext/x-diff; charset=us-asciiDownload
From bff6f0b557ff79365fc21d0ae261bad0fcb96539 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 6 Feb 2021 15:17:51 -0600
Subject: [PATCH 17/18] *an old and "deleted [has] happened"

Heikki missed this in 6b387179baab8d0e5da6570678eefbe61f3acc79
---
 doc/src/sgml/protocol.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 3763b4b995..a51f2c9920 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -6928,8 +6928,8 @@ Delete
 </term>
 <listitem>
 <para>
-                Identifies the following TupleData message as a old tuple.
-                This field is present if the table in which the delete has
+                Identifies the following TupleData message as an old tuple.
+                This field is present if the table in which the delete
                 happened has REPLICA IDENTITY set to FULL.
 </para>
 </listitem>
-- 
2.17.0

0018-doc-review-for-pg_stat_progress_create_index.patchtext/x-diff; charset=us-asciiDownload
From 389c4ac2febe21fd48480a86819d94fd2eb9c1cc Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 10 Feb 2021 17:19:51 -0600
Subject: [PATCH 18/18] doc review for pg_stat_progress_create_index

ab0dfc961b6a821f23d9c40c723d11380ce195a6

should backpatch to v13
---
 doc/src/sgml/monitoring.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index c602ee4427..16eb1d9e9c 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -5725,7 +5725,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
       </para>
       <para>
        When creating an index on a partitioned table, this column is set to
-       the number of partitions on which the index has been completed.
+       the number of partitions on which the index has been created.
       </para></entry>
      </row>
     </tbody>
-- 
2.17.0

#21Justin Pryzby
pryzby@telsasoft.com
In reply to: Justin Pryzby (#20)
21 attachment(s)
Re: doc review for v14

Rebased, with a few additions.

Attachments:

0013-doc-review-for-FDW-bulk-inserts.patchtext/x-diff; charset=us-asciiDownload
From 77bb3e5a4147a02a305943af6f74f4749a2314d0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 23 Jan 2021 17:17:58 -0600
Subject: [PATCH 13/21] doc review for FDW bulk inserts

b663a4136331de6c7364226e3dbf7c88bfee7145
---
 doc/src/sgml/fdwhandler.sgml | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/fdwhandler.sgml b/doc/src/sgml/fdwhandler.sgml
index 2e73d296d2..04bc052ee8 100644
--- a/doc/src/sgml/fdwhandler.sgml
+++ b/doc/src/sgml/fdwhandler.sgml
@@ -626,7 +626,7 @@ ExecForeignBatchInsert(EState *estate,
      Insert multiple tuples in bulk into the foreign table.
      The parameters are the same for <function>ExecForeignInsert</function>
      except <literal>slots</literal> and <literal>planSlots</literal> contain
-     multiple tuples and <literal>*numSlots></literal> specifies the number of
+     multiple tuples and <literal>*numSlots</literal> specifies the number of
      tuples in those arrays.
     </para>
 
@@ -655,7 +655,7 @@ ExecForeignBatchInsert(EState *estate,
      <literal>NULL</literal>, attempts to insert into the foreign table will
      use <function>ExecForeignInsert</function>.
      This function is not used if the <command>INSERT</command> has the
-     <literal>RETURNING></literal> clause.
+     <literal>RETURNING</literal> clause.
     </para>
 
     <para>
@@ -672,9 +672,8 @@ GetForeignModifyBatchSize(ResultRelInfo *rinfo);
 
      Report the maximum number of tuples that a single
      <function>ExecForeignBatchInsert</function> call can handle for
-     the specified foreign table.  That is, The executor passes at most
-     the number of tuples that this function returns to
-     <function>ExecForeignBatchInsert</function>.
+     the specified foreign table.  The executor passes at most
+     the given number of tuples to <function>ExecForeignBatchInsert</function>.
      <literal>rinfo</literal> is the <structname>ResultRelInfo</structname> struct describing
      the target foreign table.
      The FDW is expected to provide a foreign server and/or foreign
-- 
2.17.0

0001-doc-pageinspect.patchtext/x-diff; charset=us-asciiDownload
From 27656ceb05d495300d86df40a1d25b0b454fa18b Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 8 Jan 2021 13:09:55 -0600
Subject: [PATCH 01/21] doc: pageinspect

d6061f83a166b015657fda8623c704fcb86930e9

backpatch to 9.6?
---
 doc/src/sgml/pageinspect.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/pageinspect.sgml b/doc/src/sgml/pageinspect.sgml
index c733341984..e29eb0783a 100644
--- a/doc/src/sgml/pageinspect.sgml
+++ b/doc/src/sgml/pageinspect.sgml
@@ -211,7 +211,7 @@ test=# SELECT tuple_data_split('pg_class'::regclass, t_data, t_infomask, t_infom
      </para>
      <para>
       If <parameter>do_detoast</parameter> is <literal>true</literal>,
-      attribute that will be detoasted as needed. Default value is
+      attributes will be detoasted as needed. Default value is
       <literal>false</literal>.
      </para>
     </listitem>
-- 
2.17.0

0002-Update-comment-obsolete-since-69c3936a.patchtext/x-diff; charset=us-asciiDownload
From 53a1075b3eb883971021b642d72c9b2913e7edcb Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 15 Feb 2020 15:53:34 -0600
Subject: [PATCH 02/21] Update comment obsolete since 69c3936a

---
 src/backend/executor/nodeAgg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 1d1bf958b6..d80adc519d 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -2070,8 +2070,7 @@ initialize_hash_entry(AggState *aggstate, TupleHashTable hashtable,
 }
 
 /*
- * Look up hash entries for the current tuple in all hashed grouping sets,
- * returning an array of pergroup pointers suitable for advance_aggregates.
+ * Look up hash entries for the current tuple in all hashed grouping sets.
  *
  * Be aware that lookup_hash_entry can reset the tmpcontext.
  *
-- 
2.17.0

0003-pg_restore-must-be-specified-and-list.patchtext/x-diff; charset=us-asciiDownload
From f7c91eaf6915fcb852321496553b719bab26adf5 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Dec 2020 22:43:12 -0600
Subject: [PATCH 03/21] pg_restore: "must be specified" and --list

This was discussed here, but the idea got lost.
https://www.postgresql.org/message-id/flat/20190612170201.GA11881%40alvherre.pgsql#2984347ab074e6f198bd294fa41884df
---
 src/bin/pg_dump/pg_restore.c   | 2 +-
 src/bin/pg_dump/t/001_basic.pl | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index 589b4aed53..f6e6e41329 100644
--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -305,7 +305,7 @@ main(int argc, char **argv)
 	/* Complain if neither -f nor -d was specified (except if dumping TOC) */
 	if (!opts->cparams.dbname && !opts->filename && !opts->tocSummary)
 	{
-		pg_log_error("one of -d/--dbname and -f/--file must be specified");
+		pg_log_error("one of -d/--dbname, -f/--file, or -l/--list must be specified");
 		exit_nicely(1);
 	}
 
diff --git a/src/bin/pg_dump/t/001_basic.pl b/src/bin/pg_dump/t/001_basic.pl
index 083fb3ad08..8280914c2a 100644
--- a/src/bin/pg_dump/t/001_basic.pl
+++ b/src/bin/pg_dump/t/001_basic.pl
@@ -63,8 +63,8 @@ command_fails_like(
 
 command_fails_like(
 	['pg_restore'],
-	qr{\Qpg_restore: error: one of -d/--dbname and -f/--file must be specified\E},
-	'pg_restore: error: one of -d/--dbname and -f/--file must be specified');
+	qr{\Qpg_restore: error: one of -d/--dbname, -f/--file, or -l/--list must be specified\E},
+	'pg_restore: error: one of -d/--dbname, -f/--file, or -l/--list must be specified');
 
 command_fails_like(
 	[ 'pg_restore', '-s', '-a', '-f -' ],
-- 
2.17.0

0004-typos-in-master.patchtext/x-diff; charset=us-asciiDownload
From 8a046c822fded908660e11495bbaeabc80061513 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 14 Nov 2020 23:09:21 -0600
Subject: [PATCH 04/21] typos in master

---
 doc/src/sgml/datatype.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 7c341c8e3f..fe88c2273a 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -639,7 +639,7 @@ NUMERIC
 
     <para>
      The <literal>NaN</literal> (not a number) value is used to represent
-     undefined calculational results.  In general, any operation with
+     undefined computational results.  In general, any operation with
      a <literal>NaN</literal> input yields another <literal>NaN</literal>.
      The only exception is when the operation's other inputs are such that
      the same output would be obtained if the <literal>NaN</literal> were to
-- 
2.17.0

0021-doc-review-Add-functions-to-discard-cached-connectio.patchtext/x-diff; charset=us-asciiDownload
From f25414f2f6237f47bab59f600edcdb74f498c87b Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 18 Feb 2021 13:04:01 -0600
Subject: [PATCH 21/21] doc review: Add functions to discard cached connections

411ae64997dc3a42d19eda6721c581841ce2cb82
---
 doc/src/sgml/postgres-fdw.sgml | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/doc/src/sgml/postgres-fdw.sgml b/doc/src/sgml/postgres-fdw.sgml
index 8d6abd4c54..07aa25799d 100644
--- a/doc/src/sgml/postgres-fdw.sgml
+++ b/doc/src/sgml/postgres-fdw.sgml
@@ -553,7 +553,7 @@ postgres=# SELECT postgres_fdw_disconnect('loopback1');
      <para>
       This function discards all the open connections that are established by
       <filename>postgres_fdw</filename> from the local session to
-      the foreign servers.  If the connections are used in the current local
+      foreign servers.  If the connections are used in the current local
       transaction, they are not disconnected and warning messages are reported.
       This function returns <literal>true</literal> if it disconnects
       at least one connection, otherwise <literal>false</literal>.
@@ -585,22 +585,22 @@ postgres=# SELECT postgres_fdw_disconnect_all();
 
   <para>
    When changing the definition of or removing a foreign server or
-   a user mapping, the corresponding connections are closed.
-   But note that if the connections are used in the current local transaction
-   at that moment, they are kept until the end of the transaction.
-   Closed connections will be established again when they are necessary
-   by subsequent queries using a foreign table.
+   a user mapping, the associated connections are closed.
+   But note that if any connections are in use in the current local transaction,
+   they are kept until the end of the transaction.
+   Closed connections will be re-established when they are necessary
+   by future queries using a foreign table.
   </para>
 
   <para>
    Once a connection to a foreign server has been established,
-   it's usually kept until the local or the corresponding remote
+   it's usually kept until the local or corresponding remote
    session exits.  To disconnect a connection explicitly,
    <function>postgres_fdw_disconnect</function> and
    <function>postgres_fdw_disconnect_all</function> functions
-   need to be used.  For example, these are useful when closing
-   the connections that are no longer necessary and then preventing them
-   from consuming the foreign server connections capacity too much.
+   may be used.  For example, these are useful to close
+   connections that are no longer necessary, thereby releasing
+   connections on the foreign server.
   </para>
  </sect2>
 
-- 
2.17.0

0005-comment-typos.patchtext/x-diff; charset=us-asciiDownload
From 90dd942ad0edf792e703a6f6fc895fc023841a1f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 10 Feb 2021 17:45:07 -0600
Subject: [PATCH 05/21] comment typos

---
 src/include/lib/simplehash.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
 		uint32		curoptimal;
 		SH_ELEMENT_TYPE *entry = &data[curelem];
 
-		/* any empty bucket can directly be used */
+		/* any empty bucket can be used directly */
 		if (entry->status == SH_STATUS_EMPTY)
 		{
 			tb->members++;
-- 
2.17.0

0006-One-fewer-not-one-less.patchtext/x-diff; charset=us-asciiDownload
From 90cac9224c930d9ce4a5c52129d1d5153bec4153 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 18 Jan 2021 14:37:17 -0600
Subject: [PATCH 06/21] One fewer (not one less)

---
 contrib/pageinspect/heapfuncs.c            | 2 +-
 doc/src/sgml/charset.sgml                  | 2 +-
 doc/src/sgml/ref/create_type.sgml          | 2 +-
 doc/src/sgml/rules.sgml                    | 2 +-
 src/backend/access/common/heaptuple.c      | 4 ++--
 src/backend/commands/analyze.c             | 2 +-
 src/backend/utils/adt/jsonpath_exec.c      | 2 +-
 src/backend/utils/adt/selfuncs.c           | 2 +-
 src/backend/utils/cache/catcache.c         | 2 +-
 src/backend/utils/misc/sampling.c          | 2 +-
 src/backend/utils/mmgr/freepage.c          | 2 +-
 src/bin/pgbench/pgbench.c                  | 2 +-
 src/include/pg_config_manual.h             | 4 ++--
 src/interfaces/ecpg/include/sqlda-native.h | 2 +-
 src/test/regress/expected/geometry.out     | 2 +-
 src/test/regress/sql/geometry.sql          | 2 +-
 16 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c
index 9abcee32af..f6760eb31e 100644
--- a/contrib/pageinspect/heapfuncs.c
+++ b/contrib/pageinspect/heapfuncs.c
@@ -338,7 +338,7 @@ tuple_data_split_internal(Oid relid, char *tupdata,
 		attr = TupleDescAttr(tupdesc, i);
 
 		/*
-		 * Tuple header can specify less attributes than tuple descriptor as
+		 * Tuple header can specify fewer attributes than tuple descriptor as
 		 * ALTER TABLE ADD COLUMN without DEFAULT keyword does not actually
 		 * change tuples in pages, so attributes with numbers greater than
 		 * (t_infomask2 & HEAP_NATTS_MASK) should be treated as NULL.
diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml
index cebc09ef91..1b00e543a6 100644
--- a/doc/src/sgml/charset.sgml
+++ b/doc/src/sgml/charset.sgml
@@ -619,7 +619,7 @@ SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR";
     name such as <literal>de_DE</literal> can be considered unique
     within a given database even though it would not be unique globally.
     Use of the stripped collation names is recommended, since it will
-    make one less thing you need to change if you decide to change to
+    make one fewer thing you need to change if you decide to change to
     another database encoding.  Note however that the <literal>default</literal>,
     <literal>C</literal>, and <literal>POSIX</literal> collations can be used regardless of
     the database encoding.
diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgml
index 0b24a55505..693423e524 100644
--- a/doc/src/sgml/ref/create_type.sgml
+++ b/doc/src/sgml/ref/create_type.sgml
@@ -867,7 +867,7 @@ CREATE TYPE <replaceable class="parameter">name</replaceable>
    Before <productname>PostgreSQL</productname> version 8.3, the name of
    a generated array type was always exactly the element type's name with one
    underscore character (<literal>_</literal>) prepended.  (Type names were
-   therefore restricted in length to one less character than other names.)
+   therefore restricted in length to one fewer character than other names.)
    While this is still usually the case, the array type name may vary from
    this in case of maximum-length names or collisions with user type names
    that begin with underscore.  Writing code that depends on this convention
diff --git a/doc/src/sgml/rules.sgml b/doc/src/sgml/rules.sgml
index e81addcfa9..aa172d102b 100644
--- a/doc/src/sgml/rules.sgml
+++ b/doc/src/sgml/rules.sgml
@@ -1266,7 +1266,7 @@ CREATE [ OR REPLACE ] RULE <replaceable class="parameter">name</replaceable> AS
 <para>
     The query trees generated from rule actions are thrown into the
     rewrite system again, and maybe more rules get applied resulting
-    in more or less query trees.
+    in additional or fewer query trees.
     So a rule's actions must have either a different
     command type or a different result relation than the rule itself is
     on, otherwise this recursive process will end up in an infinite loop.
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index 24a27e387d..0b56b0fa5a 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -719,11 +719,11 @@ heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest)
 }
 
 /*
- * Expand a tuple which has less attributes than required. For each attribute
+ * Expand a tuple which has fewer attributes than required. For each attribute
  * not present in the sourceTuple, if there is a missing value that will be
  * used. Otherwise the attribute will be set to NULL.
  *
- * The source tuple must have less attributes than the required number.
+ * The source tuple must have fewer attributes than the required number.
  *
  * Only one of targetHeapTuple and targetMinimalTuple may be supplied. The
  * other argument must be NULL.
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index 7295cf0215..64908ac39c 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -1003,7 +1003,7 @@ examine_attribute(Relation onerel, int attnum, Node *index_expr)
  * As of May 2004 we use a new two-stage method:  Stage one selects up
  * to targrows random blocks (or all blocks, if there aren't so many).
  * Stage two scans these blocks and uses the Vitter algorithm to create
- * a random sample of targrows rows (or less, if there are less in the
+ * a random sample of targrows rows (or fewer, if there are fewer in the
  * sample of blocks).  The two stages are executed simultaneously: each
  * block is processed as soon as stage one returns its number and while
  * the rows are read stage two controls which ones are to be inserted
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 4d185c27b4..078aaef539 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -263,7 +263,7 @@ static int	compareDatetime(Datum val1, Oid typid1, Datum val2, Oid typid2,
  *		implement @? and @@ operators, which in turn are intended to have an
  *		index support.  Thus, it's desirable to make it easier to achieve
  *		consistency between index scan results and sequential scan results.
- *		So, we throw as less errors as possible.  Regarding this function,
+ *		So, we throw as few errors as possible.  Regarding this function,
  *		such behavior also matches behavior of JSON_EXISTS() clause of
  *		SQL/JSON.  Regarding jsonb_path_match(), this function doesn't have
  *		an analogy in SQL/JSON, so we define its behavior on our own.
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 47ca4ddbb5..52314d3aa1 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -645,7 +645,7 @@ scalarineqsel(PlannerInfo *root, Oid operator, bool isgt, bool iseq,
 
 			/*
 			 * The calculation so far gave us a selectivity for the "<=" case.
-			 * We'll have one less tuple for "<" and one additional tuple for
+			 * We'll have one fewer tuple for "<" and one additional tuple for
 			 * ">=", the latter of which we'll reverse the selectivity for
 			 * below, so we can simply subtract one tuple for both cases.  The
 			 * cases that need this adjustment can be identified by iseq being
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index fa2b49c676..55c9445898 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -1497,7 +1497,7 @@ GetCatCacheHashValue(CatCache *cache,
  *		It doesn't make any sense to specify all of the cache's key columns
  *		here: since the key is unique, there could be at most one match, so
  *		you ought to use SearchCatCache() instead.  Hence this function takes
- *		one less Datum argument than SearchCatCache() does.
+ *		one fewer Datum argument than SearchCatCache() does.
  *
  *		The caller must not modify the list object or the pointed-to tuples,
  *		and must call ReleaseCatCacheList() when done with the list.
diff --git a/src/backend/utils/misc/sampling.c b/src/backend/utils/misc/sampling.c
index 0c327e823f..7348b86682 100644
--- a/src/backend/utils/misc/sampling.c
+++ b/src/backend/utils/misc/sampling.c
@@ -42,7 +42,7 @@ BlockSampler_Init(BlockSampler bs, BlockNumber nblocks, int samplesize,
 	bs->N = nblocks;			/* measured table size */
 
 	/*
-	 * If we decide to reduce samplesize for tables that have less or not much
+	 * If we decide to reduce samplesize for tables that have fewer or not much
 	 * more than samplesize blocks, here is the place to do it.
 	 */
 	bs->n = samplesize;
diff --git a/src/backend/utils/mmgr/freepage.c b/src/backend/utils/mmgr/freepage.c
index e4ee1aab97..10a1effb74 100644
--- a/src/backend/utils/mmgr/freepage.c
+++ b/src/backend/utils/mmgr/freepage.c
@@ -495,7 +495,7 @@ FreePageManagerDump(FreePageManager *fpm)
  * if we search the parent page for the first key greater than or equal to
  * the first key on the current page, the downlink to this page will be either
  * the exact index returned by the search (if the first key decreased)
- * or one less (if the first key increased).
+ * or one fewer (if the first key increased).
  */
 static void
 FreePageBtreeAdjustAncestorKeys(FreePageManager *fpm, FreePageBtree *btp)
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index a4a3f40048..627a244fb7 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -6458,7 +6458,7 @@ threadRun(void *arg)
 
 			/*
 			 * If advanceConnectionState changed client to finished state,
-			 * that's one less client that remains.
+			 * that's one fewer client that remains.
 			 */
 			if (st->state == CSTATE_FINISHED || st->state == CSTATE_ABORTED)
 				remains--;
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index 2a12071bad..7413748a71 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -21,7 +21,7 @@
 
 /*
  * Maximum length for identifiers (e.g. table names, column names,
- * function names).  Names actually are limited to one less byte than this,
+ * function names).  Names actually are limited to one fewer byte than this,
  * because the length must include a trailing zero byte.
  *
  * Changing this requires an initdb.
@@ -87,7 +87,7 @@
 
 /*
  * MAXPGPATH: standard size of a pathname buffer in PostgreSQL (hence,
- * maximum usable pathname length is one less).
+ * maximum usable pathname length is one fewer).
  *
  * We'd use a standard system header symbol for this, if there weren't
  * so many to choose from: MAXPATHLEN, MAX_PATH, PATH_MAX are all
diff --git a/src/interfaces/ecpg/include/sqlda-native.h b/src/interfaces/ecpg/include/sqlda-native.h
index 67d3c7b4e4..9e73f1f1b1 100644
--- a/src/interfaces/ecpg/include/sqlda-native.h
+++ b/src/interfaces/ecpg/include/sqlda-native.h
@@ -7,7 +7,7 @@
 
 /*
  * Maximum length for identifiers (e.g. table names, column names,
- * function names).  Names actually are limited to one less byte than this,
+ * function names).  Names actually are limited to one fewer byte than this,
  * because the length must include a trailing zero byte.
  *
  * This should be at least as much as NAMEDATALEN of the database the
diff --git a/src/test/regress/expected/geometry.out b/src/test/regress/expected/geometry.out
index 84f7eabb66..9799cfbdbd 100644
--- a/src/test/regress/expected/geometry.out
+++ b/src/test/regress/expected/geometry.out
@@ -4325,7 +4325,7 @@ SELECT f1, polygon(8, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';
  <(100,1),115>  | ((-15,1),(18.6827201635,82.3172798365),(100,116),(181.317279836,82.3172798365),(215,1),(181.317279836,-80.3172798365),(100,-114),(18.6827201635,-80.3172798365))
 (6 rows)
 
--- Too less points error
+-- Too few points error
 SELECT f1, polygon(1, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';
 ERROR:  must request at least 2 points
 -- Zero radius error
diff --git a/src/test/regress/sql/geometry.sql b/src/test/regress/sql/geometry.sql
index 96df0ab05a..b0ab6d03ec 100644
--- a/src/test/regress/sql/geometry.sql
+++ b/src/test/regress/sql/geometry.sql
@@ -424,7 +424,7 @@ SELECT f1, f1::polygon FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';
 -- To polygon with less points
 SELECT f1, polygon(8, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';
 
--- Too less points error
+-- Too few points error
 SELECT f1, polygon(1, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>';
 
 -- Zero radius error
-- 
2.17.0

0007-function-comment-get_am_name.patchtext/x-diff; charset=us-asciiDownload
From 908da434f1b3598021002112d29622e3fa9e1ae3 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 30 Dec 2020 09:39:16 -0600
Subject: [PATCH 07/21] function comment: get_am_name

---
 src/backend/commands/amcmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/commands/amcmds.c b/src/backend/commands/amcmds.c
index eff9535ed0..188109e474 100644
--- a/src/backend/commands/amcmds.c
+++ b/src/backend/commands/amcmds.c
@@ -186,7 +186,7 @@ get_am_oid(const char *amname, bool missing_ok)
 }
 
 /*
- * get_am_name - given an access method OID name and type, look up its name.
+ * get_am_name - given an access method OID, look up its name.
  */
 char *
 get_am_name(Oid amOid)
-- 
2.17.0

0008-an-exclusive.patchtext/x-diff; charset=us-asciiDownload
From d7b698bfbc176dc46aeda5202aa717103cfafef1 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 6 Feb 2021 15:13:37 -0600
Subject: [PATCH 08/21] *an exclusive

3c84046490bed3c22e0873dc6ba492e02b8b9051
---
 doc/src/sgml/ref/drop_index.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/drop_index.sgml b/doc/src/sgml/ref/drop_index.sgml
index 85cf23bca2..b6d2c2014f 100644
--- a/doc/src/sgml/ref/drop_index.sgml
+++ b/doc/src/sgml/ref/drop_index.sgml
@@ -45,7 +45,7 @@ DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] <replaceable class="parameter">name</r
      <para>
       Drop the index without locking out concurrent selects, inserts, updates,
       and deletes on the index's table.  A normal <command>DROP INDEX</command>
-      acquires exclusive lock on the table, blocking other accesses until the
+      acquires an exclusive lock on the table, blocking other accesses until the
       index drop can be completed.  With this option, the command instead
       waits until conflicting transactions have completed.
      </para>
-- 
2.17.0

0009-Doc-review-for-psql-dX.patchtext/x-diff; charset=us-asciiDownload
From c416a2935730e27216c4d6389e1ad8bacef0de6b Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 20 Jan 2021 16:10:49 -0600
Subject: [PATCH 09/21] Doc review for psql \dX

ad600bba0422dde4b73fbd61049ff2a3847b068a
---
 doc/src/sgml/ref/psql-ref.sgml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..d0f397d5ea 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1930,8 +1930,9 @@ testdb=&gt;
         </para>
 
         <para>
-        The column of the kind of extended stats (e.g. Ndistinct) shows its status.
-        NULL means that it doesn't exists. "defined" means that it was requested
+        The status of each kind of extended statistics is shown in a column
+        named after the "kind" (e.g. Ndistinct).
+        NULL means that it doesn't exist. "defined" means that it was requested
         when creating the statistics.
         You can use pg_stats_ext if you'd like to know whether <link linkend="sql-analyze">
         <command>ANALYZE</command></link> was run and statistics are available to the
-- 
2.17.0

0010-doc-review-for-checksum-docs.patchtext/x-diff; charset=us-asciiDownload
From 6bc94e1935c97cf3a2df54f4210d454004c70045 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 17 Jan 2021 10:57:21 -0600
Subject: [PATCH 10/21] doc review for checksum docs

cf621d9d84db1e6edaff8ffa26bad93fdce5f830
---
 doc/src/sgml/wal.sgml | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml
index 66de1ee2f8..02f576a1a9 100644
--- a/doc/src/sgml/wal.sgml
+++ b/doc/src/sgml/wal.sgml
@@ -237,19 +237,19 @@
   </indexterm>
 
   <para>
-   Data pages are not checksum protected by default, but this can optionally be
-   enabled for a cluster.  When enabled, each data page will be assigned a
-   checksum that is updated when the page is written and verified every time
-   the page is read. Only data pages are protected by checksums, internal data
+   By default, data pages are not protected by checksums, but this can optionally be
+   enabled for a cluster.  When enabled, each data page will be ASSIGNED a
+   checksum that is updated when the page is written and verified each time
+   the page is read. Only data pages are protected by checksums; internal data
    structures and temporary files are not.
   </para>
 
   <para>
-   Checksums are normally enabled when the cluster is initialized using <link
+   Checksums verification is normally ENABLED when the cluster is initialized using <link
    linkend="app-initdb-data-checksums"><application>initdb</application></link>.
    They can also be enabled or disabled at a later time as an offline
    operation. Data checksums are enabled or disabled at the full cluster
-   level, and cannot be specified individually for databases or tables.
+   level, and cannot be specified for individual databases or tables.
   </para>
 
   <para>
@@ -260,9 +260,9 @@
   </para>
 
   <para>
-   When attempting to recover from corrupt data it may be necessary to bypass
-   the checksum protection in order to recover data. To do this, temporarily
-   set the configuration parameter <xref linkend="guc-ignore-checksum-failure" />.
+   When attempting to recover from corrupt data, it may be necessary to bypass
+   the checksum protection. To do this, temporarily set the configuration
+   parameter <xref linkend="guc-ignore-checksum-failure" />.
   </para>
 
   <sect2 id="checksums-offline-enable-disable">
-- 
2.17.0

0011-duplicate-words.patchtext/x-diff; charset=us-asciiDownload
From 8e76b2b6f82f4a03039e130e1f9dae053f5dbf03 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 30 Jan 2021 18:10:21 -0600
Subject: [PATCH 11/21] duplicate words

commit 9c4f5192f69ed16c99e0d079f0b5faebd7bad212
    Allow pg_rewind to use a standby server as the source system.

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

commit 0a2bc5d61e713e3fe72438f020eea5fcc90b0f0b
    Move per-agg and per-trans duplicate finding to the planner.

commit 623a9ba79bbdd11c5eccb30b8bd5c446130e521c
    snapshot scalability: cache snapshots using a xact completion counter.

commit 2c03216d831160bedd72d45f712601b6f7d03f1c
    Revamp the WAL record format.
---
 src/backend/access/transam/xlogutils.c  | 3 +--
 src/backend/optimizer/prep/prepagg.c    | 2 +-
 src/backend/storage/ipc/procarray.c     | 2 +-
 src/bin/pg_rewind/libpq_source.c        | 2 +-
 src/test/regress/expected/tuplesort.out | 2 +-
 src/test/regress/sql/tuplesort.sql      | 2 +-
 6 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c
index e723253297..25d6df1659 100644
--- a/src/backend/access/transam/xlogutils.c
+++ b/src/backend/access/transam/xlogutils.c
@@ -433,8 +433,7 @@ XLogReadBufferForRedoExtended(XLogReaderState *record,
  * NB: A redo function should normally not call this directly. To get a page
  * to modify, use XLogReadBufferForRedoExtended instead. It is important that
  * all pages modified by a WAL record are registered in the WAL records, or
- * they will be invisible to tools that that need to know which pages are
- * modified.
+ * they will be invisible to tools that need to know which pages are modified.
  */
 Buffer
 XLogReadBufferExtended(RelFileNode rnode, ForkNumber forknum,
diff --git a/src/backend/optimizer/prep/prepagg.c b/src/backend/optimizer/prep/prepagg.c
index 929a8ea13b..89046f9afb 100644
--- a/src/backend/optimizer/prep/prepagg.c
+++ b/src/backend/optimizer/prep/prepagg.c
@@ -71,7 +71,7 @@ static Datum GetAggInitVal(Datum textInitVal, Oid transtype);
  *
  * Information about the aggregates and transition functions are collected
  * in the root->agginfos and root->aggtransinfos lists.  The 'aggtranstype',
- * 'aggno', and 'aggtransno' fields in are filled in in each Aggref.
+ * 'aggno', and 'aggtransno' fields of each Aggref are filled in.
  *
  * NOTE: This modifies the Aggrefs in the input expression in-place!
  *
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index 4085891237..c1e86fb35c 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -2049,7 +2049,7 @@ GetSnapshotDataReuse(Snapshot snapshot)
 	 * holding ProcArrayLock) exclusively). Thus the xactCompletionCount check
 	 * ensures we would detect if the snapshot would have changed.
 	 *
-	 * As the snapshot contents are the same as it was before, it is is safe
+	 * As the snapshot contents are the same as it was before, it is safe
 	 * to re-enter the snapshot's xmin into the PGPROC array. None of the rows
 	 * visible under the snapshot could already have been removed (that'd
 	 * require the set of running transactions to change) and it fulfills the
diff --git a/src/bin/pg_rewind/libpq_source.c b/src/bin/pg_rewind/libpq_source.c
index 86d2adcaee..ac794cf4eb 100644
--- a/src/bin/pg_rewind/libpq_source.c
+++ b/src/bin/pg_rewind/libpq_source.c
@@ -539,7 +539,7 @@ process_queued_fetch_requests(libpq_source *src)
 						 chunkoff, rq->path, (int64) rq->offset);
 
 			/*
-			 * We should not receive receive more data than we requested, or
+			 * We should not receive more data than we requested, or
 			 * pg_read_binary_file() messed up.  We could receive less,
 			 * though, if the file was truncated in the source after we
 			 * checked its size. That's OK, there should be a WAL record of
diff --git a/src/test/regress/expected/tuplesort.out b/src/test/regress/expected/tuplesort.out
index 3fc1998bf2..418f296a3f 100644
--- a/src/test/regress/expected/tuplesort.out
+++ b/src/test/regress/expected/tuplesort.out
@@ -1,7 +1,7 @@
 -- only use parallelism when explicitly intending to do so
 SET max_parallel_maintenance_workers = 0;
 SET max_parallel_workers = 0;
--- A table with with contents that, when sorted, triggers abbreviated
+-- A table with contents that, when sorted, triggers abbreviated
 -- key aborts. One easy way to achieve that is to use uuids that all
 -- have the same prefix, as abbreviated keys for uuids just use the
 -- first sizeof(Datum) bytes.
diff --git a/src/test/regress/sql/tuplesort.sql b/src/test/regress/sql/tuplesort.sql
index 7d7e02f02a..846484d561 100644
--- a/src/test/regress/sql/tuplesort.sql
+++ b/src/test/regress/sql/tuplesort.sql
@@ -2,7 +2,7 @@
 SET max_parallel_maintenance_workers = 0;
 SET max_parallel_workers = 0;
 
--- A table with with contents that, when sorted, triggers abbreviated
+-- A table with contents that, when sorted, triggers abbreviated
 -- key aborts. One easy way to achieve that is to use uuids that all
 -- have the same prefix, as abbreviated keys for uuids just use the
 -- first sizeof(Datum) bytes.
-- 
2.17.0

0012-doc-review-piecemeal-construction-of-partitioned-ind.patchtext/x-diff; charset=us-asciiDownload
From 4f3498cebb44c07725e27a517673e720f65cbd0d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 3 Feb 2021 00:51:25 -0600
Subject: [PATCH 12/21] doc review: piecemeal construction of partitioned
 indexes

5efd604ec0a3bdde98fe19d8cada69ab4ef80db3

backpatch to v11
---
 doc/src/sgml/ddl.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 1e9a4625cc..a8cbd45d35 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3962,8 +3962,8 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02
      As explained above, it is possible to create indexes on partitioned tables
      so that they are applied automatically to the entire hierarchy.
      This is very
-     convenient, as not only will the existing partitions become indexed, but
-     also any partitions that are created in the future will.  One limitation is
+     convenient, as not only the existing partitions will be indexed, but
+     so will any partitions that are created in the future.  One limitation is
      that it's not possible to use the <literal>CONCURRENTLY</literal>
      qualifier when creating such a partitioned index.  To avoid long lock
      times, it is possible to use <command>CREATE INDEX ON ONLY</command>
-- 
2.17.0

0014-doc-review-logical-decode-in-prepare.patchtext/x-diff; charset=us-asciiDownload
From 5e2f8875fdf78459ca2bdf17ffe407374a215973 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 23 Jan 2021 20:33:10 -0600
Subject: [PATCH 14/21] doc review: logical decode in prepare

a271a1b50e9bec07e2ef3a05e38e7285113e4ce6
---
 doc/src/sgml/logicaldecoding.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index cf705ed9cd..b854f2ccfc 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -1214,7 +1214,7 @@ stream_commit_cb(...);  &lt;-- commit of the streamed transaction
    </para>
 
    <para>
-    When a prepared transaction is rollbacked using the
+    When a prepared transaction is rolled back using the
     <command>ROLLBACK PREPARED</command>, then the
     <function>rollback_prepared_cb</function> callback is invoked and when the
     prepared transaction is committed using <command>COMMIT PREPARED</command>,
-- 
2.17.0

0015-doc-review-for-multiranges.patchtext/x-diff; charset=us-asciiDownload
From 9f9e1d7f838f988ddf629bb8ceef6d8e97ff714a Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 23 Jan 2021 21:02:47 -0600
Subject: [PATCH 15/21] doc review for multiranges

6df7a9698bb036610c1e8c6d375e1be38cb26d5f
---
 doc/src/sgml/extend.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml
index 6e3d82b85b..ec95b4eb01 100644
--- a/doc/src/sgml/extend.sgml
+++ b/doc/src/sgml/extend.sgml
@@ -448,7 +448,7 @@
      of <type>anycompatible</type> and <type>anycompatiblenonarray</type>
      inputs, the array element types of <type>anycompatiblearray</type>
      inputs, the range subtypes of <type>anycompatiblerange</type> inputs,
-     and the multirange subtypes of <type>anycompatiablemultirange</type>
+     and the multirange subtypes of <type>anycompatiblemultirange</type>
      inputs.  If <type>anycompatiblenonarray</type> is present then the
      common type is required to be a non-array type.  Once a common type is
      identified, arguments in <type>anycompatible</type>
-- 
2.17.0

0016-doc-review-for-logical-decoding-of-prepared-xacts.patchtext/x-diff; charset=us-asciiDownload
From 402515b2e2e49409618c127a1c804ed831d8dcbd Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 23 Jan 2021 21:03:37 -0600
Subject: [PATCH 16/21] doc review for logical decoding of prepared xacts

0aa8a01d04c8fe200b7a106878eebc3d0af9105c
---
 doc/src/sgml/logicaldecoding.sgml | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index b854f2ccfc..71e9f36b8e 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -791,9 +791,9 @@ typedef void (*LogicalDecodeMessageCB) (struct LogicalDecodingContext *ctx,
      <para>
        The optional <function>filter_prepare_cb</function> callback
        is called to determine whether data that is part of the current
-       two-phase commit transaction should be considered for decode
-       at this prepare stage or as a regular one-phase transaction at
-       <command>COMMIT PREPARED</command> time later. To signal that
+       two-phase commit transaction should be considered for decoding
+       at this prepare stage or later as a regular one-phase transaction at
+       <command>COMMIT PREPARED</command> time. To signal that
        decoding should be skipped, return <literal>true</literal>;
        <literal>false</literal> otherwise. When the callback is not
        defined, <literal>false</literal> is assumed (i.e. nothing is
@@ -820,11 +820,11 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx
       The required <function>begin_prepare_cb</function> callback is called
       whenever the start of a prepared transaction has been decoded. The
       <parameter>gid</parameter> field, which is part of the
-      <parameter>txn</parameter> parameter can be used in this callback to
-      check if the plugin has already received this prepare in which case it
+      <parameter>txn</parameter> parameter, can be used in this callback to
+      check if the plugin has already received this PREPARE in which case it
       can skip the remaining changes of the transaction. This can only happen
-      if the user restarts the decoding after receiving the prepare for a
-      transaction but before receiving the commit prepared say because of some
+      if the user restarts the decoding after receiving the PREPARE for a
+      transaction but before receiving the COMMIT PREPARED, say because of some
       error.
       <programlisting>
        typedef void (*LogicalDecodeBeginPrepareCB) (struct LogicalDecodingContext *ctx,
@@ -842,7 +842,7 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx
       decoded. The <function>change_cb</function> callback for all modified
       rows will have been called before this, if there have been any modified
       rows. The <parameter>gid</parameter> field, which is part of the
-      <parameter>txn</parameter> parameter can be used in this callback.
+      <parameter>txn</parameter> parameter, can be used in this callback.
       <programlisting>
        typedef void (*LogicalDecodePrepareCB) (struct LogicalDecodingContext *ctx,
                                                ReorderBufferTXN *txn,
@@ -856,9 +856,9 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx
 
      <para>
       The required <function>commit_prepared_cb</function> callback is called
-      whenever a transaction commit prepared has been decoded. The
+      whenever a transaction COMMIT PREPARED has been decoded. The
       <parameter>gid</parameter> field, which is part of the
-      <parameter>txn</parameter> parameter can be used in this callback.
+      <parameter>txn</parameter> parameter, can be used in this callback.
       <programlisting>
        typedef void (*LogicalDecodeCommitPreparedCB) (struct LogicalDecodingContext *ctx,
                                                       ReorderBufferTXN *txn,
@@ -872,15 +872,15 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx
 
      <para>
       The required <function>rollback_prepared_cb</function> callback is called
-      whenever a transaction rollback prepared has been decoded. The
+      whenever a transaction ROLLBACK PREPARED has been decoded. The
       <parameter>gid</parameter> field, which is part of the
-      <parameter>txn</parameter> parameter can be used in this callback. The
+      <parameter>txn</parameter> parameter, can be used in this callback. The
       parameters <parameter>prepare_end_lsn</parameter> and
       <parameter>prepare_time</parameter> can be used to check if the plugin
-      has received this prepare transaction in which case it can apply the
+      has received this PREPARE TRANSACTION in which case it can apply the
       rollback, otherwise, it can skip the rollback operation. The
       <parameter>gid</parameter> alone is not sufficient because the downstream
-      node can have prepared transaction with same identifier.
+      node can have a prepared transaction with same identifier.
       <programlisting>
        typedef void (*LogicalDecodeRollbackPreparedCB) (struct LogicalDecodingContext *ctx,
                                                         ReorderBufferTXN *txn,
@@ -1122,7 +1122,7 @@ OutputPluginWrite(ctx, true);
     the <function>stream_commit_cb</function> callback
     (or possibly aborted using the <function>stream_abort_cb</function> callback).
     If two-phase commits are supported, the transaction can be prepared using the
-    <function>stream_prepare_cb</function> callback, commit prepared using the
+    <function>stream_prepare_cb</function> callback, COMMIT PREPARED using the
     <function>commit_prepared_cb</function> callback or aborted using the
     <function>rollback_prepared_cb</function>.
    </para>
-- 
2.17.0

0017-an-old-and-deleted-has-happened.patchtext/x-diff; charset=us-asciiDownload
From a0a58a8da9a4144ad684f095dd2b5f6aa2b8eee4 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 6 Feb 2021 15:17:51 -0600
Subject: [PATCH 17/21] *an old and "deleted [has] happened"

Heikki missed this in 6b387179baab8d0e5da6570678eefbe61f3acc79
---
 doc/src/sgml/protocol.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 3763b4b995..a51f2c9920 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -6928,8 +6928,8 @@ Delete
 </term>
 <listitem>
 <para>
-                Identifies the following TupleData message as a old tuple.
-                This field is present if the table in which the delete has
+                Identifies the following TupleData message as an old tuple.
+                This field is present if the table in which the delete
                 happened has REPLICA IDENTITY set to FULL.
 </para>
 </listitem>
-- 
2.17.0

0018-doc-review-for-pg_stat_progress_create_index.patchtext/x-diff; charset=us-asciiDownload
From 8c723d5f0478c6c98af9e7a2fbeb3c79bb095a25 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 10 Feb 2021 17:19:51 -0600
Subject: [PATCH 18/21] doc review for pg_stat_progress_create_index

ab0dfc961b6a821f23d9c40c723d11380ce195a6

should backpatch to v13
---
 doc/src/sgml/monitoring.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 3513e127b7..7509a41ba0 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -5726,7 +5726,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
       </para>
       <para>
        When creating an index on a partitioned table, this column is set to
-       the number of partitions on which the index has been completed.
+       the number of partitions on which the index has been created.
        This field is <literal>0</literal> during a <literal>REINDEX</literal>.
       </para></entry>
      </row>
-- 
2.17.0

0019-doc-review-Multiple-xacts-during-table-sync-in-logic.patchtext/x-diff; charset=us-asciiDownload
From 285ecb5f14e20acf889938be2e4804c26f0e1deb Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 18 Feb 2021 10:08:27 -0600
Subject: [PATCH 19/21] doc review: Multiple xacts during table sync in logical
 replication

ce0fdbfe9722867b7fad4d3ede9b6a6bfc51fb4e
---
 doc/src/sgml/logical-replication.sgml    | 4 ++--
 doc/src/sgml/ref/alter_subscription.sgml | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index d0742f2c52..69a9768504 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -490,9 +490,9 @@
      any changes that happened during the initial data copy using standard
      logical replication.  During this synchronization phase, the changes
      are applied and committed in the same order as they happened on the
-     publisher.  Once the synchronization is done, the control of the
+     publisher.  Once synchronization is done, control of the
      replication of the table is given back to the main apply process where
-     the replication continues as normal.
+     replication continues as normal.
     </para>
   </sect2>
  </sect1>
diff --git a/doc/src/sgml/ref/alter_subscription.sgml b/doc/src/sgml/ref/alter_subscription.sgml
index bcb0acf28d..0adf68ecca 100644
--- a/doc/src/sgml/ref/alter_subscription.sgml
+++ b/doc/src/sgml/ref/alter_subscription.sgml
@@ -56,7 +56,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
    allocated for the subscription on the remote host are released. If due to
    network breakdown or some other error, <productname>PostgreSQL</productname>
    is unable to remove the slots, an ERROR will be reported. To proceed in this
-   situation, either the user need to retry the operation or disassociate the
+   situation, the user either needs to retry the operation or disassociate the
    slot from the subscription and drop the subscription as explained in
    <xref linkend="sql-dropsubscription"/>.
   </para>
-- 
2.17.0

0020-doc-review-for-VACUUM-PROCESS_TOAST.patchtext/x-diff; charset=us-asciiDownload
From e3149e34a5f31563437cb18af55df660aabb9f6b Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 18 Feb 2021 10:13:15 -0600
Subject: [PATCH 20/21] doc review for VACUUM (PROCESS_TOAST)

7cb3048f38e26b39dd5fd412ed8a4981b6809b35
---
 doc/src/sgml/ref/vacuum.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/vacuum.sgml b/doc/src/sgml/ref/vacuum.sgml
index 4bb624979b..cc7e1a8547 100644
--- a/doc/src/sgml/ref/vacuum.sgml
+++ b/doc/src/sgml/ref/vacuum.sgml
@@ -219,7 +219,7 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ ANALYZE ] [ <replaceable class="paramet
       corresponding <literal>TOAST</literal> table for each relation, if one
       exists. This is normally the desired behavior and is the default.
       Setting this option to false may be useful when it is only necessary to
-      vacuum the main relation. This option is required when the
+      vacuum the main relation. This option may not be disabled when the
       <literal>FULL</literal> option is used.
      </para>
     </listitem>
-- 
2.17.0

#22Michael Paquier
michael@paquier.xyz
In reply to: Justin Pryzby (#21)
Re: doc review for v14

On Mon, Feb 22, 2021 at 02:03:45AM -0600, Justin Pryzby wrote:

Rebased, with a few additions.

Thanks. I have done a pass through this series, and applied most of
this stuff with a backpatch for the doc portions.

+        The status of each kind of extended statistics is shown in a column
+        named after the "kind" (e.g. Ndistinct).
+        NULL means that it doesn't exist. "defined" means that it was requested
From 0009, there is a grammar mistake on HEAD here, but I don't
understand what you mean by "kind" here.  Wouldn't it be better to not
use quotes and just refer to "its type of statistics"?

0016 was missing some <command> markups.

This leaves 0003, 0004, 0005, 0010, 0012, 0018, 0020 and 0021 as these
did not look like improvements after review.
--
Michael

#23Justin Pryzby
pryzby@telsasoft.com
In reply to: Michael Paquier (#22)
Re: doc review for v14

On Wed, Feb 24, 2021 at 04:18:51PM +0900, Michael Paquier wrote:

On Mon, Feb 22, 2021 at 02:03:45AM -0600, Justin Pryzby wrote:

Rebased, with a few additions.

Thanks. I have done a pass through this series, and applied most of
this stuff with a backpatch for the doc portions.

+        The status of each kind of extended statistics is shown in a column
+        named after the "kind" (e.g. Ndistinct).
+        NULL means that it doesn't exist. "defined" means that it was requested
From 0009, there is a grammar mistake on HEAD here, but I don't
understand what you mean by "kind" here.  Wouldn't it be better to not
use quotes and just refer to "its type of statistics"?

I mean stxkind. "type" doesn't mean anything.

0016 was missing some <command> markups.

This leaves 0003, 0004, 0005, 0010, 0012, 0018, 0020 and 0021 as these
did not look like improvements after review.

Thanks.

-      vacuum the main relation. This option is required when the
+      vacuum the main relation. This option may not be disabled when the
       <literal>FULL</literal> option is used.

"This option is required.." sounds like "this option must be specified", which
is wrong.

-     publisher.  Once the synchronization is done, the control of the
+     publisher.  Once synchronization is done, control of the
      replication of the table is given back to the main apply process where
-     the replication continues as normal.
+     replication continues as normal.

I think "the synchronization" is ok, but "the control" is poor, and "the
replication" is unneeded.

        When creating an index on a partitioned table, this column is set to
-       the number of partitions on which the index has been completed.
+       the number of partitions on which the index has been created.

What is index "completion" ?

      This is very
-     convenient, as not only will the existing partitions become indexed, but
-     also any partitions that are created in the future will.  One limitation is
+     convenient, as not only the existing partitions will be indexed, but
+     so will any partitions that are created in the future.  One limitation is

"become indexed" sounds strange (and vague), and "will." is additionally awkward.

--
Justin

#24Michael Paquier
michael@paquier.xyz
In reply to: Justin Pryzby (#23)
Re: doc review for v14

On Wed, Feb 24, 2021 at 01:39:55AM -0600, Justin Pryzby wrote:

On Wed, Feb 24, 2021 at 04:18:51PM +0900, Michael Paquier wrote:

+        The status of each kind of extended statistics is shown in a column
+        named after the "kind" (e.g. Ndistinct).
+        NULL means that it doesn't exist. "defined" means that it was requested
From 0009, there is a grammar mistake on HEAD here, but I don't
understand what you mean by "kind" here.  Wouldn't it be better to not
use quotes and just refer to "its type of statistics"?

I mean stxkind. "type" doesn't mean anything.

How would you reword that then?

-      vacuum the main relation. This option is required when the
+      vacuum the main relation. This option may not be disabled when the
<literal>FULL</literal> option is used.

"This option is required.." sounds like "this option must be specified", which
is wrong.

Hmm. Wouldn't it be better to say then "this option cannot be
disabled when FULL is used"?

When creating an index on a partitioned table, this column is set to
-       the number of partitions on which the index has been completed.
+       the number of partitions on which the index has been created.

What is index "completion" ?

Done with. Perhaps Alvaro has a comment to offer here as this comes
from ab0dfc9.

This is very
-     convenient, as not only will the existing partitions become indexed, but
-     also any partitions that are created in the future will.  One limitation is
+     convenient, as not only the existing partitions will be indexed, but
+     so will any partitions that are created in the future.  One limitation is

"become indexed" sounds strange (and vague), and "will." is additionally awkward.

Not that strange to me (see dbca945).
--
Michael

#25Justin Pryzby
pryzby@telsasoft.com
In reply to: Michael Paquier (#22)
2 attachment(s)
Re: doc review for v14

On Wed, Feb 24, 2021 at 04:18:51PM +0900, Michael Paquier wrote:

This leaves 0003, 0004, 0005, 0010, 0012, 0018, 0020 and 0021 as these
did not look like improvements after review.

It looks like you applied 0010...but I agree that it's not an improvement. It
appears that's something I intended to go back and revisit myself.
The rest of the patch looks right, to me.

Subject: [PATCH 10/21] doc review for checksum docs
doc/src/sgml/wal.sgml | 18 +++++++++---------

I'm suggesting to either revert that part, or apply these more polished changes
in 0002.

--
Justin

Attachments:

0001-Partially-revert-bcf2667bf62d72faced64cb60ffbd2e599a.patchtext/x-diff; charset=us-asciiDownload
From 03d014809720d90ba43c780cb34fc82dd7173c8d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 26 Feb 2021 19:42:54 -0600
Subject: [PATCH 1/2] Partially revert bcf2667bf62d72faced64cb60ffbd2e599a0ebe8

---
 doc/src/sgml/wal.sgml | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml
index 02f576a1a9..66de1ee2f8 100644
--- a/doc/src/sgml/wal.sgml
+++ b/doc/src/sgml/wal.sgml
@@ -237,19 +237,19 @@
   </indexterm>
 
   <para>
-   By default, data pages are not protected by checksums, but this can optionally be
-   enabled for a cluster.  When enabled, each data page will be ASSIGNED a
-   checksum that is updated when the page is written and verified each time
-   the page is read. Only data pages are protected by checksums; internal data
+   Data pages are not checksum protected by default, but this can optionally be
+   enabled for a cluster.  When enabled, each data page will be assigned a
+   checksum that is updated when the page is written and verified every time
+   the page is read. Only data pages are protected by checksums, internal data
    structures and temporary files are not.
   </para>
 
   <para>
-   Checksums verification is normally ENABLED when the cluster is initialized using <link
+   Checksums are normally enabled when the cluster is initialized using <link
    linkend="app-initdb-data-checksums"><application>initdb</application></link>.
    They can also be enabled or disabled at a later time as an offline
    operation. Data checksums are enabled or disabled at the full cluster
-   level, and cannot be specified for individual databases or tables.
+   level, and cannot be specified individually for databases or tables.
   </para>
 
   <para>
@@ -260,9 +260,9 @@
   </para>
 
   <para>
-   When attempting to recover from corrupt data, it may be necessary to bypass
-   the checksum protection. To do this, temporarily set the configuration
-   parameter <xref linkend="guc-ignore-checksum-failure" />.
+   When attempting to recover from corrupt data it may be necessary to bypass
+   the checksum protection in order to recover data. To do this, temporarily
+   set the configuration parameter <xref linkend="guc-ignore-checksum-failure" />.
   </para>
 
   <sect2 id="checksums-offline-enable-disable">
-- 
2.17.0

0002-Second-attempt-to-improve-checksum-docs.patchtext/x-diff; charset=us-asciiDownload
From bed0d532bc2415cea1e2da54b6842053ecc27e04 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 26 Feb 2021 19:56:25 -0600
Subject: [PATCH 2/2] Second attempt to improve checksum docs

'assigned' is odd

Each not every

Colon not comma

Rephase 'Checksums are normally enabled...', since this is easy to mis-interpret and sounds like they're enabled by default

Do not repeat: 'to recover...data'
---
 doc/src/sgml/wal.sgml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml
index 66de1ee2f8..347be030b2 100644
--- a/doc/src/sgml/wal.sgml
+++ b/doc/src/sgml/wal.sgml
@@ -238,18 +238,18 @@
 
   <para>
    Data pages are not checksum protected by default, but this can optionally be
-   enabled for a cluster.  When enabled, each data page will be assigned a
-   checksum that is updated when the page is written and verified every time
-   the page is read. Only data pages are protected by checksums, internal data
+   enabled for a cluster.  When enabled, a checksum is included in each data page
+   when the page is written and verified each time
+   the page is read. Only data pages are protected by checksums; internal data
    structures and temporary files are not.
   </para>
 
   <para>
-   Checksums are normally enabled when the cluster is initialized using <link
+   Enabling checksums is normally done when the cluster is first create by <link
    linkend="app-initdb-data-checksums"><application>initdb</application></link>.
    They can also be enabled or disabled at a later time as an offline
    operation. Data checksums are enabled or disabled at the full cluster
-   level, and cannot be specified individually for databases or tables.
+   level, and cannot be specified for individual databases or tables.
   </para>
 
   <para>
@@ -260,8 +260,8 @@
   </para>
 
   <para>
-   When attempting to recover from corrupt data it may be necessary to bypass
-   the checksum protection in order to recover data. To do this, temporarily
+   When attempting to recover from corrupt data, it may be necessary to bypass
+   the checksum protection. To do this, temporarily
    set the configuration parameter <xref linkend="guc-ignore-checksum-failure" />.
   </para>
 
-- 
2.17.0

#26Michael Paquier
michael@paquier.xyz
In reply to: Justin Pryzby (#25)
1 attachment(s)
Re: doc review for v14

On Sun, Feb 28, 2021 at 06:46:47PM -0600, Justin Pryzby wrote:

It looks like you applied 0010...but I agree that it's not an improvement. It
appears that's something I intended to go back and revisit myself.
The rest of the patch looks right, to me.

Oops. This was not intended.

I'm suggesting to either revert that part, or apply these more polished changes
in 0002.

I would just group both things together. Monday helping, I can see
that the new wording is better on a couple of points after doing a
diff of wal.sgml with c82d59d6:
- "checksum protected" in the first sentence is weird, so I agree that
using "By default, data pages are not protected by checksums" is an
improvement.
- "assigned" is indeed a bit strange, "includes" is an improvement,
and I would tend to not use a passive form here.
- "to recover from corrupt data" is redundant with "to recover data"
so the second one should be removed. My take is to use "page
corruptions" instead of "corrupt data", which should be corrupted data
to be grammatically correct.

This gives the attached, that has as result to not change the second
paragraph compared to the pre-c82d59d6 version of the area.
--
Michael

Attachments:

checksum-docs-v3.patchtext/x-diff; charset=us-asciiDownload
diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml
index 02f576a1a9..f75527f764 100644
--- a/doc/src/sgml/wal.sgml
+++ b/doc/src/sgml/wal.sgml
@@ -237,19 +237,19 @@
   </indexterm>
 
   <para>
-   By default, data pages are not protected by checksums, but this can optionally be
-   enabled for a cluster.  When enabled, each data page will be ASSIGNED a
-   checksum that is updated when the page is written and verified each time
+   By default, data pages are not protected by checksums, but this can
+   optionally be enabled for a cluster. When enabled, each data page includes
+   a checksum that is updated when the page is written and verified each time
    the page is read. Only data pages are protected by checksums; internal data
    structures and temporary files are not.
   </para>
 
   <para>
-   Checksums verification is normally ENABLED when the cluster is initialized using <link
+   Checksums are normally enabled when the cluster is initialized using <link
    linkend="app-initdb-data-checksums"><application>initdb</application></link>.
    They can also be enabled or disabled at a later time as an offline
    operation. Data checksums are enabled or disabled at the full cluster
-   level, and cannot be specified for individual databases or tables.
+   level, and cannot be specified individually for databases or tables.
   </para>
 
   <para>
@@ -260,9 +260,9 @@
   </para>
 
   <para>
-   When attempting to recover from corrupt data, it may be necessary to bypass
-   the checksum protection. To do this, temporarily set the configuration
-   parameter <xref linkend="guc-ignore-checksum-failure" />.
+   When attempting to recover from page corruptions, it may be necessary to
+   bypass the checksum protection. To do this, temporarily set the
+   configuration parameter <xref linkend="guc-ignore-checksum-failure" />.
   </para>
 
   <sect2 id="checksums-offline-enable-disable">
#27Justin Pryzby
pryzby@telsasoft.com
In reply to: Michael Paquier (#26)
Re: doc review for v14

On Mon, Mar 01, 2021 at 01:11:10PM +0900, Michael Paquier wrote:

On Sun, Feb 28, 2021 at 06:46:47PM -0600, Justin Pryzby wrote:

It looks like you applied 0010...but I agree that it's not an improvement. It
appears that's something I intended to go back and revisit myself.
The rest of the patch looks right, to me.

Oops. This was not intended.

I'm suggesting to either revert that part, or apply these more polished changes
in 0002.

I would just group both things together. Monday helping, I can see
that the new wording is better on a couple of points after doing a
diff of wal.sgml with c82d59d6:
- "checksum protected" in the first sentence is weird, so I agree that
using "By default, data pages are not protected by checksums" is an
improvement.
- "assigned" is indeed a bit strange, "includes" is an improvement,
and I would tend to not use a passive form here.

+1

- "to recover from corrupt data" is redundant with "to recover data"
so the second one should be removed. My take is to use "page
corruptions" instead of "corrupt data", which should be corrupted data
to be grammatically correct.

-   Checksums verification is normally ENABLED when the cluster is initialized using <link
+   Checksums are normally enabled when the cluster is initialized using <link

I still have an issue with the sentence that begins:
"Checksums are normally enabled..."

It sounds much too close to "Checksums are typically enabled.", which is wrong.
So I proposed something like:

|Enabling checksums is normally done when the cluster is first created by <link
|...

Note, the patch I sent said "create" but should be "created".

-   When attempting to recover from corrupt data, it may be necessary to bypass
-   the checksum protection. To do this, temporarily set the configuration
-   parameter <xref linkend="guc-ignore-checksum-failure" />.
+   When attempting to recover from page corruptions, it may be necessary to
+   bypass the checksum protection. To do this, temporarily set the
+   configuration parameter <xref linkend="guc-ignore-checksum-failure" />.

"page corruptions" is wrong .. you could say "corrupt pages"

--
Justin

#28Michael Paquier
michael@paquier.xyz
In reply to: Justin Pryzby (#27)
Re: doc review for v14

On Sun, Feb 28, 2021 at 10:33:55PM -0600, Justin Pryzby wrote:

I still have an issue with the sentence that begins:
"Checksums are normally enabled..."

You could say here "Checksums can be enabled", but "normally" does not
sound bad to me either as it insists on the fact that it is better to
do that when the cluster is initdb'd as this has no downtime compared
to enabling checksums on an existing cluster.

Note, the patch I sent said "create" but should be "created".

Initialized sounds better to me, FWIW.

"page corruptions" is wrong .. you could say "corrupt pages"

"corruptED pages" would sound more correct to me as something that has
already happened. Anyway, I'd rather keep what I am proposing
upthread.
--
Michael

#29Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#28)
Re: doc review for v14

On Mon, Mar 01, 2021 at 03:17:40PM +0900, Michael Paquier wrote:

You could say here "Checksums can be enabled", but "normally" does not
sound bad to me either as it insists on the fact that it is better to
do that when the cluster is initdb'd as this has no downtime compared
to enabling checksums on an existing cluster.

I looked at that again this morning, and the last version sent
upthread still looked fine to me, so I have just applied that.

Thanks for caring about that, Justin.
--
Michael

#30Justin Pryzby
pryzby@telsasoft.com
In reply to: Justin Pryzby (#27)
32 attachment(s)
Re: doc review for v14

Another round of doc review, not yet including all of yesterday's commits.

29c8d614c3 duplicate words
diff --git a/src/include/lib/sort_template.h b/src/include/lib/sort_template.h
index 771c789ced..24d6d0006c 100644
--- a/src/include/lib/sort_template.h
+++ b/src/include/lib/sort_template.h
@@ -241,7 +241,7 @@ ST_SCOPE void ST_SORT(ST_ELEMENT_TYPE *first, size_t n
 /*
  * Find the median of three values.  Currently, performance seems to be best
- * if the the comparator is inlined here, but the med3 function is not inlined
+ * if the comparator is inlined here, but the med3 function is not inlined
  * in the qsort function.
  */
 static pg_noinline ST_ELEMENT_TYPE *
e7c370c7c5 pg_amcheck: remove Double semi-colon
diff --git a/src/bin/pg_amcheck/t/004_verify_heapam.pl b/src/bin/pg_amcheck/t/004_verify_heapam.pl
index 36607596b1..2171d236a7 100644
--- a/src/bin/pg_amcheck/t/004_verify_heapam.pl
+++ b/src/bin/pg_amcheck/t/004_verify_heapam.pl
@@ -175,7 +175,7 @@ sub write_tuple
 	seek($fh, $offset, 0)
 		or BAIL_OUT("seek failed: $!");
 	defined(syswrite($fh, $buffer, HEAPTUPLE_PACK_LENGTH))
-		or BAIL_OUT("syswrite failed: $!");;
+		or BAIL_OUT("syswrite failed: $!");
 	return;
 }
b745e9e60e a statistics objects
diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index 463d44a68a..4674168ff8 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -254,7 +254,7 @@ BuildRelationExtStatistics(Relation onerel, double totalrows,
  * that would require additional columns.
  *
  * See statext_compute_stattarget for details about how we compute statistics
- * target for a statistics objects (from the object target, attribute targets
+ * target for a statistics object (from the object target, attribute targets
  * and default statistics target).
  */
 int
e7d5c5d9dc guc.h: remove mention of "doit"
diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h
index 1892c7927b..1126b34798 100644
--- a/src/include/utils/guc.h
+++ b/src/include/utils/guc.h
@@ -90,8 +90,7 @@ typedef enum
  * dividing line between "interactive" and "non-interactive" sources for
  * error reporting purposes.
  *
- * PGC_S_TEST is used when testing values to be used later ("doit" will always
- * be false, so this never gets stored as the actual source of any value).
+ * PGC_S_TEST is used when testing values to be used later.
  * For example, ALTER DATABASE/ROLE tests proposed per-database or per-user
  * defaults this way, and CREATE FUNCTION tests proposed function SET clauses
  * this way.  This is an interactive case, but it needs its own source value
ad5f9a2023 Caller
diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c
index 9961d27df4..09fcff6729 100644
--- a/src/backend/utils/adt/jsonfuncs.c
+++ b/src/backend/utils/adt/jsonfuncs.c
@@ -1651,7 +1651,7 @@ push_null_elements(JsonbParseState **ps, int num)
  * this path. E.g. the path [a][0][b] with the new value 1 will produce the
  * structure {a: [{b: 1}]}.
  *
- * Called is responsible to make sure such path does not exist yet.
+ * Caller is responsible to make sure such path does not exist yet.
  */
 static void
 push_path(JsonbParseState **st, int level, Datum *path_elems,
@@ -4887,7 +4887,7 @@ IteratorConcat(JsonbIterator **it1, JsonbIterator **it2,
  * than just one last element, this flag will instruct to create the whole
  * chain of corresponding objects and insert the value.
  *
- * JB_PATH_CONSISTENT_POSITION for an array indicates that the called wants to
+ * JB_PATH_CONSISTENT_POSITION for an array indicates that the caller wants to
  * keep values with fixed indices. Indices for existing elements could be
  * changed (shifted forward) in case if the array is prepended with a new value
  * and a negative index out of the range, so this behavior will be prevented
9acedbd4af as
diff --git a/src/backend/commands/copyfrom.c b/src/backend/commands/copyfrom.c
index 20e7d57d41..40a54ad0bd 100644
--- a/src/backend/commands/copyfrom.c
+++ b/src/backend/commands/copyfrom.c
@@ -410,7 +410,7 @@ CopyMultiInsertBufferCleanup(CopyMultiInsertInfo *miinfo,
  * Once flushed we also trim the tracked buffers list down to size by removing
  * the buffers created earliest first.
  *
- * Callers should pass 'curr_rri' is the ResultRelInfo that's currently being
+ * Callers should pass 'curr_rri' as the ResultRelInfo that's currently being
  * used.  When cleaning up old buffers we'll never remove the one for
  * 'curr_rri'.
  */
9f78de5042 exist
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index 5bdaceefd5..182a133033 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -617,7 +617,7 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
 	 *
 	 * We assume that VACUUM hasn't set pg_class.reltuples already, even
 	 * during a VACUUM ANALYZE.  Although VACUUM often updates pg_class,
-	 * exceptions exists.  A "VACUUM (ANALYZE, INDEX_CLEANUP OFF)" command
+	 * exceptions exist.  A "VACUUM (ANALYZE, INDEX_CLEANUP OFF)" command
 	 * will never update pg_class entries for index relations.  It's also
 	 * possible that an individual index's pg_class entry won't be updated
 	 * during VACUUM if the index AM returns NULL from its amvacuumcleanup()
a45af383ae rebuilt
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index 096a06f7b3..6487a9e3fc 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -1422,7 +1422,7 @@ finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
 								 PROGRESS_CLUSTER_PHASE_FINAL_CLEANUP);
 	/*
-	 * If the relation being rebuild is pg_class, swap_relation_files()
+	 * If the relation being rebuilt is pg_class, swap_relation_files()
 	 * couldn't update pg_class's own pg_class entry (check comments in
 	 * swap_relation_files()), thus relfrozenxid was not updated. That's
 	 * annoying because a potential reason for doing a VACUUM FULL is a
f24c2c1075 docs review: logical replication
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index a382258aee..bc4a8b2279 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -4137,7 +4137,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
          On the subscriber side, specifies how many replication origins (see
          <xref linkend="replication-origins"/>) can be tracked simultaneously,
          effectively limiting how many logical replication subscriptions can
-         be created on the server. Setting it a lower value than the current
+         be created on the server. Setting it to a lower value than the current
          number of tracked replication origins (reflected in
          <link linkend="view-pg-replication-origin-status">pg_replication_origin_status</link>,
          not <link linkend="catalog-pg-replication-origin">pg_replication_origin</link>)
diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index 3fad5f34e6..7645ee032c 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -602,13 +602,12 @@
   </para>
   <para>
-   The subscriber also requires the <varname>max_replication_slots</varname>
-   be set to configure how many replication origins can be tracked.  In this
-   case it should be set to at least the number of subscriptions that will be
-   added to the subscriber, plus some reserve for table synchronization.
-   <varname>max_logical_replication_workers</varname> must be set to at least
-   the number of subscriptions, again plus some reserve for the table
-   synchronization.  Additionally the <varname>max_worker_processes</varname>
+   <varname>max_replication_slots</varname> must also be set on the subscriber.
+   It should be set to at least the number of
+   subscriptions that will be added to the subscriber, plus some reserve for
+   table synchronization.  <varname>max_logical_replication_workers</varname>
+   must be set to at least the number of subscriptions, again plus some reserve
+   for the table synchronization.  Additionally the <varname>max_worker_processes</varname>
    may need to be adjusted to accommodate for replication workers, at least
    (<varname>max_logical_replication_workers</varname>
    + <literal>1</literal>).  Note that some extensions and parallel queries
83f9954468 accessmtd
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 9f6303266f..ba03e8aa8f 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -1119,6 +1119,7 @@ AddNewRelationType(const char *typeName,
  *	reltypeid: OID to assign to rel's rowtype, or InvalidOid to select one
  *	reloftypeid: if a typed table, OID of underlying type; else InvalidOid
  *	ownerid: OID of new rel's owner
+ *	accessmtd: OID of new rel's access method
  *	tupdesc: tuple descriptor (source of column definitions)
  *	cooked_constraints: list of precooked check constraints and defaults
  *	relkind: relkind for new rel
573eeb8666 language fixen
diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml
index 3bbae6dd91..4adb34a21b 100644
--- a/doc/src/sgml/maintenance.sgml
+++ b/doc/src/sgml/maintenance.sgml
@@ -185,7 +185,7 @@
     never issue <command>VACUUM FULL</command>.  In this approach, the idea
     is not to keep tables at their minimum size, but to maintain steady-state
     usage of disk space: each table occupies space equivalent to its
-    minimum size plus however much space gets used up between vacuumings.
+    minimum size plus however much space gets used up between vacuum runs.
     Although <command>VACUUM FULL</command> can be used to shrink a table back
     to its minimum size and return the disk space to the operating system,
     there is not much point in this if the table will just grow again in the
diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml
index d1af624f44..89ff58338e 100644
--- a/doc/src/sgml/perform.sgml
+++ b/doc/src/sgml/perform.sgml
@@ -1899,7 +1899,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
     much faster.  The following are configuration changes you can make
     to improve performance in such cases.  Except as noted below, durability
     is still guaranteed in case of a crash of the database software;
-    only abrupt operating system stoppage creates a risk of data loss
+    only an abrupt operating system crash creates a risk of data loss
     or corruption when these settings are used.
     <itemizedlist>
diff --git a/doc/src/sgml/ref/createuser.sgml b/doc/src/sgml/ref/createuser.sgml
index 4d60dc2cda..17579e50af 100644
--- a/doc/src/sgml/ref/createuser.sgml
+++ b/doc/src/sgml/ref/createuser.sgml
@@ -44,7 +44,7 @@ PostgreSQL documentation
    If you wish to create a new superuser, you must connect as a
    superuser, not merely with <literal>CREATEROLE</literal> privilege.
    Being a superuser implies the ability to bypass all access permission
-   checks within the database, so superuserdom should not be granted lightly.
+   checks within the database, so superuser access should not be granted lightly.
   </para>
   <para>
d37a8a04f7 wal_compression
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index cf4e82e8b5..a382258aee 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3098,7 +3098,7 @@ include_dir 'conf.d'
       <listitem>
        <para>
         When this parameter is <literal>on</literal>, the <productname>PostgreSQL</productname>
-        server compresses a full page image written to WAL when
+        server compresses full page images written to WAL when
         <xref linkend="guc-full-page-writes"/> is on or during a base backup.
         A compressed page image will be decompressed during WAL replay.
         The default value is <literal>off</literal>.
e6025e2e81 amcheck
diff --git a/doc/src/sgml/amcheck.sgml b/doc/src/sgml/amcheck.sgml
index a2571d33ae..30fcb033e3 100644
--- a/doc/src/sgml/amcheck.sgml
+++ b/doc/src/sgml/amcheck.sgml
@@ -457,14 +457,13 @@ SET client_min_messages = DEBUG1;
    </listitem>
    <listitem>
     <para>
-     File system or storage subsystem faults where checksums happen to
-     simply not be enabled.
+     File system or storage subsystem faults where checksums are
+     not enabled.
     </para>
     <para>
-     Note that <filename>amcheck</filename> examines a page as represented in some
-     shared memory buffer at the time of verification if there is only a
-     shared buffer hit when accessing the block. Consequently,
-     <filename>amcheck</filename> does not necessarily examine data read from the
+     Note that <filename>amcheck</filename> examines a page as represented in a
+     shared memory buffer at the time of verification.  If the page is cached,
+     <filename>amcheck</filename> will not examine data read from the
      file system at the time of verification. Note that when checksums are
      enabled, <filename>amcheck</filename> may raise an error due to a checksum
      failure when a corrupt block is read into a buffer.
d987f0505e spell: vacuum
diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml
index 44e50620fd..d7fffddbce 100644
--- a/doc/src/sgml/ref/create_table.sgml
+++ b/doc/src/sgml/ref/create_table.sgml
@@ -1520,7 +1520,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
     </listitem>
    </varlistentry>
-   <varlistentry id="reloption-autovacuum-vauum-scale-factor" xreflabel="autovacuum_vacuum_scale_factor">
+   <varlistentry id="reloption-autovacuum-vacuum-scale-factor" xreflabel="autovacuum_vacuum_scale_factor">
     <term><literal>autovacuum_vacuum_scale_factor</literal>, <literal>toast.autovacuum_vacuum_scale_factor</literal> (<type>floating point</type>)
     <indexterm>
      <primary><varname>autovacuum_vacuum_scale_factor</varname> </primary>
@@ -1610,7 +1610,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
     </listitem>
    </varlistentry>
-   <varlistentry id="reloption-autovacuum-vauum-cost-limit" xreflabel="autovacuum_vacuum_cost_limit">
+   <varlistentry id="reloption-autovacuum-vacuum-cost-limit" xreflabel="autovacuum_vacuum_cost_limit">
     <term><literal>autovacuum_vacuum_cost_limit</literal>, <literal>toast.autovacuum_vacuum_cost_limit</literal> (<type>integer</type>)
     <indexterm>
      <primary><varname>autovacuum_vacuum_cost_limit</varname></primary>
69e597176b doc review: Fix use of cursor sensitivity terminology
diff --git a/doc/src/sgml/ref/declare.sgml b/doc/src/sgml/ref/declare.sgml
index 8a2b8cc892..aa3d1d1fa1 100644
--- a/doc/src/sgml/ref/declare.sgml
+++ b/doc/src/sgml/ref/declare.sgml
@@ -335,7 +335,7 @@ DECLARE liahona CURSOR FOR SELECT * FROM films;
   <para>
    According to the SQL standard, changes made to insensitive cursors by
    <literal>UPDATE ... WHERE CURRENT OF</literal> and <literal>DELETE
-   ... WHERE CURRENT OF</literal> statements are visibible in that same
+   ... WHERE CURRENT OF</literal> statements are visible in that same
    cursor.  <productname>PostgreSQL</productname> treats these statements like
    all other data changing statements in that they are not visible in
    insensitive cursors.
3399caf133 doc review: Make use of in-core query id added by commit 5fd9dfa5f5
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 04712769ca..cf4e82e8b5 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -7732,7 +7732,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
         The <xref linkend="pgstatstatements"/> extension also requires a query
         identifier to be computed.  Note that an external module can
         alternatively be used if the in-core query identifier computation
-        specification isn't acceptable.  In this case, in-core computation
+        method isn't acceptable.  In this case, in-core computation
         must be disabled.  The default is <literal>off</literal>.
        </para>
        <note>
567b33c755 doc review: Move pg_stat_statements query jumbling to core.
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index ae1a38b8bc..04712769ca 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -7737,7 +7737,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
        </para>
        <note>
         <para>
-         To ensure that a only one query identifier is calculated and
+         To ensure that only one query identifier is calculated and
          displayed, extensions that calculate query identifiers should
          throw an error if a query identifier has already been computed.
         </para>
diff --git a/doc/src/sgml/pgstatstatements.sgml b/doc/src/sgml/pgstatstatements.sgml
index 5ad4f0aed2..e235504e9a 100644
--- a/doc/src/sgml/pgstatstatements.sgml
+++ b/doc/src/sgml/pgstatstatements.sgml
@@ -406,7 +406,7 @@
   <note>
    <para>
     The following details about constant replacement and
-    <structfield>queryid</structfield> only applies when <xref
+    <structfield>queryid</structfield> only apply when <xref
     linkend="guc-compute-query-id"/> is enabled.  If you use an external
     module instead to compute <structfield>queryid</structfield>, you
     should refer to its documentation for details.
e292ee3e35 doc review: Add function to log the memory contexts of specified backend process.
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index be22f4b61b..679738f615 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -24926,12 +24926,12 @@ SELECT collation for ('foo' COLLATE "de_DE");
         <returnvalue>boolean</returnvalue>
        </para>
        <para>
-        Requests to log the memory contexts whose backend process has
-        the specified process ID.  These memory contexts will be logged at
+        Requests to log the memory contexts of the backend with the
+        specified process ID.  These memory contexts will be logged at
         <literal>LOG</literal> message level. They will appear in
         the server log based on the log configuration set
         (See <xref linkend="runtime-config-logging"/> for more information),
-        but will not be sent to the client whatever the setting of
+        but will not be sent to the client regardless of
         <xref linkend="guc-client-min-messages"/>.
         Only superusers can request to log the memory contexts.
        </para></entry>
@@ -25037,9 +25037,9 @@ SELECT collation for ('foo' COLLATE "de_DE");
    <para>
     <function>pg_log_backend_memory_contexts</function> can be used
-    to log the memory contexts of the backend process. For example,
+    to log the memory contexts of a backend process. For example,
 <programlisting>
-postgres=# SELECT pg_log_backend_memory_contexts(pg_backend_pid());
+postgres=# SELECT pg_log_backend_memory_contexts(pg_backend_pid()); -- XXX
  pg_log_backend_memory_contexts 
 --------------------------------
  t
@@ -25061,8 +25061,8 @@ LOG:  level: 1; TransactionAbortContext: 32768 total in 1 blocks; 32504 free (0
 LOG:  level: 1; ErrorContext: 8192 total in 1 blocks; 7928 free (3 chunks); 264 used
 LOG:  Grand total: 1651920 bytes in 201 blocks; 622360 free (88 chunks); 1029560 used
 </screen>
-    For more than 100 child contexts under the same parent one,
-    100 child contexts and a summary of the remaining ones will be logged.
+    If there are more than 100 child contexts under the same parent, the first
+    100 child contexts are logged, along with a summary of the remaining contexts.
     Note that frequent calls to this function could incur significant overhead,
     because it may generate a large number of log messages.
    </para>
85330eeda7 doc review: Stop archive recovery if WAL generated with wal_level=minimal is found.
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 26628f3e6d..ae1a38b8bc 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -2723,7 +2723,7 @@ include_dir 'conf.d'
         Note that changing <varname>wal_level</varname> to
         <literal>minimal</literal> makes any base backups taken before
         unavailable for archive recovery and standby server, which may
-        lead to database loss.
+        lead to data loss.
        </para>
        <para>
         In <literal>logical</literal> level, the same information is logged as
diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml
index e0d3f246e9..d1af624f44 100644
--- a/doc/src/sgml/perform.sgml
+++ b/doc/src/sgml/perform.sgml
@@ -1747,7 +1747,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
     <xref linkend="guc-max-wal-senders"/> to zero.
     But note that changing these settings requires a server restart,
     and makes any base backups taken before unavailable for archive
-    recovery and standby server, which may lead to database loss.
+    recovery and standby server, which may lead to data loss.
    </para>
    <para>
dfdae1597d doc review: Add unistr function
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 7b75e0bca2..be22f4b61b 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -3560,7 +3560,7 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
         <returnvalue>text</returnvalue>
        </para>
        <para>
-        Evaluate escaped Unicode characters in argument.  Unicode characters
+        Evaluate escaped Unicode characters in the argument.  Unicode characters
         can be specified as
         <literal>\<replaceable>XXXX</replaceable></literal> (4 hexadecimal
         digits), <literal>\+<replaceable>XXXXXX</replaceable></literal> (6
491445e3c9 doc review: postgres_fdw: Add option to control whether to keep connections open.
diff --git a/doc/src/sgml/postgres-fdw.sgml b/doc/src/sgml/postgres-fdw.sgml
index fd34956936..e8cb679164 100644
--- a/doc/src/sgml/postgres-fdw.sgml
+++ b/doc/src/sgml/postgres-fdw.sgml
@@ -551,8 +551,8 @@ OPTIONS (ADD password_required 'false');
     <title>Connection Management Options</title>
     <para>
-     By default all the open connections that <filename>postgres_fdw</filename>
-     established to the foreign servers are kept in local session for re-use.
+     By default, all connections that <filename>postgres_fdw</filename>
+     establishes to foreign servers are kept open for re-use in the local session.
     </para>
     <variablelist>
@@ -562,11 +562,11 @@ OPTIONS (ADD password_required 'false');
       <listitem>
        <para>
         This option controls whether <filename>postgres_fdw</filename> keeps
-        the connections to the foreign server open so that the subsequent
+        the connections to the foreign server open so that subsequent
         queries can re-use them. It can only be specified for a foreign server.
         The default is <literal>on</literal>. If set to <literal>off</literal>,
         all connections to this foreign server will be discarded at the end of
-        transaction.
+        each transaction.
       </para>
       </listitem>
      </varlistentry>
95a43e5c2d doc review: BRIN minmax-multi indexes
diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index d2476481af..ce7c210575 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -730,7 +730,7 @@ LOG:  request for BRIN range summarization for index "brin_wi_idx" page 128 was
      for <xref linkend="sql-altertable"/>. When set to a positive value,
      each block range is assumed to contain this number of distinct non-null
      values. When set to a negative value, which must be greater than or
-     equal to -1, the number of distinct non-null is assumed linear with
+     equal to -1, the number of distinct non-null values is assumed to grow linearly with
      the maximum possible number of tuples in the block range (about 290
      rows per block). The default value is <literal>-0.1</literal>, and
      the minimum number of distinct non-null values is <literal>16</literal>.
@@ -1214,7 +1214,7 @@ typedef struct BrinOpcInfo
  <para>
   The minmax-multi operator class is also intended for data types implementing
-  a totally ordered sets, and may be seen as a simple extension of the minmax
+  a totally ordered set, and may be seen as a simple extension of the minmax
   operator class. While minmax operator class summarizes values from each block
   range into a single contiguous interval, minmax-multi allows summarization
   into multiple smaller intervals to improve handling of outlier values.
e53ac30d44 doc review: Track total amounts of times spent writing and syncing WAL data to disk.
diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml
index 0f13c43095..24cf567ee2 100644
--- a/doc/src/sgml/wal.sgml
+++ b/doc/src/sgml/wal.sgml
@@ -797,7 +797,7 @@
    <literal>fsync</literal>, or <literal>fsync_writethrough</literal>,
    the write operation moves WAL buffers to kernel cache and
    <function>issue_xlog_fsync</function> syncs them to disk. Regardless
-   of the setting of <varname>track_wal_io_timing</varname>, the numbers
+   of the setting of <varname>track_wal_io_timing</varname>, the number
    of times <function>XLogWrite</function> writes and
    <function>issue_xlog_fsync</function> syncs WAL data to disk are also
    counted as <literal>wal_write</literal> and <literal>wal_sync</literal>
6e0c552d1c doc review: Be clear about whether a recovery pause has taken effect.
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 0606b6a9aa..7b75e0bca2 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -25576,7 +25576,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
         Returns recovery pause state.  The return values are <literal>
         not paused</literal> if pause is not requested, <literal>
         pause requested</literal> if pause is requested but recovery is
-        not yet paused and, <literal>paused</literal> if the recovery is
+        not yet paused, and <literal>paused</literal> if the recovery is
         actually paused.
        </para></entry>
       </row>
4bbf35a579 doc review: Add pg_amcheck, a CLI for contrib/amcheck.
diff --git a/doc/src/sgml/ref/pg_amcheck.sgml b/doc/src/sgml/ref/pg_amcheck.sgml
index fcc96b430a..d01e26faa8 100644
--- a/doc/src/sgml/ref/pg_amcheck.sgml
+++ b/doc/src/sgml/ref/pg_amcheck.sgml
@@ -460,7 +460,7 @@ PostgreSQL documentation
      <term><option>--skip=<replaceable class="parameter">option</replaceable></option></term>
      <listitem>
       <para>
-       If <literal>"all-frozen"</literal> is given, table corruption checks
+       If <literal>all-frozen</literal> is given, table corruption checks
        will skip over pages in all tables that are marked as all frozen.
       </para>
       <para>
c7bf0bcc61 doc review: Pass all scan keys to BRIN consistent function at once
diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index d2f12bb605..d2476481af 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -833,7 +833,7 @@ typedef struct BrinOpcInfo
       Returns whether all the ScanKey entries are consistent with the given
       indexed values for a range.
       The attribute number to use is passed as part of the scan key.
-      Multiple scan keys for the same attribute may be passed at once, the
+      Multiple scan keys for the same attribute may be passed at once; the
       number of entries is determined by the <literal>nkeys</literal> parameter.
      </para>
     </listitem>
50454d9cf5 doc review: Add support for PROVE_TESTS and PROVE_FLAGS in MSVC scripts
diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml
index 64687b12e6..cb6bb05dc5 100644
--- a/doc/src/sgml/install-windows.sgml
+++ b/doc/src/sgml/install-windows.sgml
@@ -499,8 +499,8 @@ $ENV{PERL5LIB}=$ENV{PERL5LIB} . ';c:\IPC-Run-0.94\lib';
   <para>
    The TAP tests run with <command>vcregress</command> support the
-   environment variables <varname>PROVE_TESTS</varname>, that is expanded
-   automatically using the name patterns given, and
+   environment variables <varname>PROVE_TESTS</varname>, which is
+   expanded as a glob pattern, and
    <varname>PROVE_FLAGS</varname>. These can be set on a Windows terminal,
    before running <command>vcregress</command>:
 <programlisting>
633e7a3b54 doc review: VACUUM (PROCESS_TOAST)
diff --git a/doc/src/sgml/ref/vacuum.sgml b/doc/src/sgml/ref/vacuum.sgml
index 6a0028a514..949ca23797 100644
--- a/doc/src/sgml/ref/vacuum.sgml
+++ b/doc/src/sgml/ref/vacuum.sgml
@@ -219,7 +219,7 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ ANALYZE ] [ <replaceable class="paramet
       corresponding <literal>TOAST</literal> table for each relation, if one
       exists. This is normally the desired behavior and is the default.
       Setting this option to false may be useful when it is only necessary to
-      vacuum the main relation. This option is required when the
+      vacuum the main relation. This option may not be disabled when the
       <literal>FULL</literal> option is used.
      </para>
     </listitem>
7e84a06724 doc review: Multiple xacts during table sync in logical replication
diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index e95d446dac..3fad5f34e6 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -490,9 +490,9 @@
      any changes that happened during the initial data copy using standard
      logical replication.  During this synchronization phase, the changes
      are applied and committed in the same order as they happened on the
-     publisher.  Once the synchronization is done, the control of the
+     publisher.  Once synchronization is done, control of the
      replication of the table is given back to the main apply process where
-     the replication continues as normal.
+     replication continues as normal.
     </para>
   </sect2>
  </sect1>
8259924473 doc review: pg_stat_progress_create_index
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index f637fe0415..8287587f61 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -5890,7 +5890,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
       </para>
       <para>
        When creating an index on a partitioned table, this column is set to
-       the number of partitions on which the index has been completed.
+       the number of partitions on which the index has been created.
        This field is <literal>0</literal> during a <literal>REINDEX</literal>.
       </para></entry>
      </row>
576580e6c3 doc review: piecemeal construction of partitioned indexes
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 30e4170963..354f9e57bd 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3957,8 +3957,8 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02
      As explained above, it is possible to create indexes on partitioned tables
      so that they are applied automatically to the entire hierarchy.
      This is very
-     convenient, as not only will the existing partitions become indexed, but
-     also any partitions that are created in the future will.  One limitation is
+     convenient, as not only the existing partitions will be indexed, but
+     so will any partitions that are created in the future.  One limitation is
      that it's not possible to use the <literal>CONCURRENTLY</literal>
      qualifier when creating such a partitioned index.  To avoid long lock
      times, it is possible to use <command>CREATE INDEX ON ONLY</command>
1384db4053 doc review: psql \dX
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index ddb7043362..a3cfd3b557 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1927,9 +1927,10 @@ testdb=&gt;
         </para>
         <para>
-        The column of the kind of extended stats (e.g. Ndistinct) shows its status.
-        NULL means that it doesn't exists. "defined" means that it was requested
-        when creating the statistics.
+        The status of each kind of extended statistics is shown in a column
+        named after its statistic kind (e.g. Ndistinct).
+        "defined" means that it was requested when creating the statistics,
+        and NULL means it wasn't requested. 
         You can use pg_stats_ext if you'd like to know whether <link linkend="sql-analyze">
         <command>ANALYZE</command></link> was run and statistics are available to the
         planner.

Attachments:

0001-doc-review-psql-dX.patchtext/x-diff; charset=us-asciiDownload
From 1384db4053a3eea6bf8fef05ee6a961ba8d2a6b0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 20 Jan 2021 16:10:49 -0600
Subject: [PATCH 01/32] doc review: psql \dX

ad600bba0422dde4b73fbd61049ff2a3847b068a
---
 doc/src/sgml/ref/psql-ref.sgml | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index ddb7043362..a3cfd3b557 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1927,9 +1927,10 @@ testdb=&gt;
         </para>
 
         <para>
-        The column of the kind of extended stats (e.g. Ndistinct) shows its status.
-        NULL means that it doesn't exists. "defined" means that it was requested
-        when creating the statistics.
+        The status of each kind of extended statistics is shown in a column
+        named after its statistic kind (e.g. Ndistinct).
+        "defined" means that it was requested when creating the statistics,
+        and NULL means it wasn't requested. 
         You can use pg_stats_ext if you'd like to know whether <link linkend="sql-analyze">
         <command>ANALYZE</command></link> was run and statistics are available to the
         planner.
-- 
2.17.0

0002-doc-review-piecemeal-construction-of-partitioned-ind.patchtext/x-diff; charset=us-asciiDownload
From 576580e6c3e2eb432b845fd3b0f494ec388e2ee0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 3 Feb 2021 00:51:25 -0600
Subject: [PATCH 02/32] doc review: piecemeal construction of partitioned
 indexes

5efd604ec0a3bdde98fe19d8cada69ab4ef80db3

backpatch to v11
---
 doc/src/sgml/ddl.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 30e4170963..354f9e57bd 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3957,8 +3957,8 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02
      As explained above, it is possible to create indexes on partitioned tables
      so that they are applied automatically to the entire hierarchy.
      This is very
-     convenient, as not only will the existing partitions become indexed, but
-     also any partitions that are created in the future will.  One limitation is
+     convenient, as not only the existing partitions will be indexed, but
+     so will any partitions that are created in the future.  One limitation is
      that it's not possible to use the <literal>CONCURRENTLY</literal>
      qualifier when creating such a partitioned index.  To avoid long lock
      times, it is possible to use <command>CREATE INDEX ON ONLY</command>
-- 
2.17.0

0003-doc-review-pg_stat_progress_create_index.patchtext/x-diff; charset=us-asciiDownload
From 8259924473598523890fd3dd556f1053e3906861 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 10 Feb 2021 17:19:51 -0600
Subject: [PATCH 03/32] doc review: pg_stat_progress_create_index

ab0dfc961b6a821f23d9c40c723d11380ce195a6

should backpatch to v13
---
 doc/src/sgml/monitoring.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index f637fe0415..8287587f61 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -5890,7 +5890,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
       </para>
       <para>
        When creating an index on a partitioned table, this column is set to
-       the number of partitions on which the index has been completed.
+       the number of partitions on which the index has been created.
        This field is <literal>0</literal> during a <literal>REINDEX</literal>.
       </para></entry>
      </row>
-- 
2.17.0

0004-doc-review-Multiple-xacts-during-table-sync-in-logic.patchtext/x-diff; charset=us-asciiDownload
From 7e84a06724c1fd7ec582823106956a0056e58e00 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 18 Feb 2021 10:08:27 -0600
Subject: [PATCH 04/32] doc review: Multiple xacts during table sync in logical
 replication

ce0fdbfe9722867b7fad4d3ede9b6a6bfc51fb4e
---
 doc/src/sgml/logical-replication.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index e95d446dac..3fad5f34e6 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -490,9 +490,9 @@
      any changes that happened during the initial data copy using standard
      logical replication.  During this synchronization phase, the changes
      are applied and committed in the same order as they happened on the
-     publisher.  Once the synchronization is done, the control of the
+     publisher.  Once synchronization is done, control of the
      replication of the table is given back to the main apply process where
-     the replication continues as normal.
+     replication continues as normal.
     </para>
   </sect2>
  </sect1>
-- 
2.17.0

0005-doc-review-VACUUM-PROCESS_TOAST.patchtext/x-diff; charset=us-asciiDownload
From 633e7a3b54abaf6fe78eadd621dd8e027cbbb403 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 18 Feb 2021 10:13:15 -0600
Subject: [PATCH 05/32] doc review: VACUUM (PROCESS_TOAST)

7cb3048f38e26b39dd5fd412ed8a4981b6809b35
---
 doc/src/sgml/ref/vacuum.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/vacuum.sgml b/doc/src/sgml/ref/vacuum.sgml
index 6a0028a514..949ca23797 100644
--- a/doc/src/sgml/ref/vacuum.sgml
+++ b/doc/src/sgml/ref/vacuum.sgml
@@ -219,7 +219,7 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ ANALYZE ] [ <replaceable class="paramet
       corresponding <literal>TOAST</literal> table for each relation, if one
       exists. This is normally the desired behavior and is the default.
       Setting this option to false may be useful when it is only necessary to
-      vacuum the main relation. This option is required when the
+      vacuum the main relation. This option may not be disabled when the
       <literal>FULL</literal> option is used.
      </para>
     </listitem>
-- 
2.17.0

0006-doc-review-Add-support-for-PROVE_TESTS-and-PROVE_FLA.patchtext/x-diff; charset=us-asciiDownload
From 50454d9cf5199b6a248a71167525c2356da25886 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 4 Mar 2021 19:32:05 -0600
Subject: [PATCH 06/32] doc review: Add support for PROVE_TESTS and PROVE_FLAGS
 in MSVC scripts

5bca69a76b3046a85c60c48271c1831fd5affa51
---
 doc/src/sgml/install-windows.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml
index 64687b12e6..cb6bb05dc5 100644
--- a/doc/src/sgml/install-windows.sgml
+++ b/doc/src/sgml/install-windows.sgml
@@ -499,8 +499,8 @@ $ENV{PERL5LIB}=$ENV{PERL5LIB} . ';c:\IPC-Run-0.94\lib';
 
   <para>
    The TAP tests run with <command>vcregress</command> support the
-   environment variables <varname>PROVE_TESTS</varname>, that is expanded
-   automatically using the name patterns given, and
+   environment variables <varname>PROVE_TESTS</varname>, which is
+   expanded as a glob pattern, and
    <varname>PROVE_FLAGS</varname>. These can be set on a Windows terminal,
    before running <command>vcregress</command>:
 <programlisting>
-- 
2.17.0

0007-doc-review-Pass-all-scan-keys-to-BRIN-consistent-fun.patchtext/x-diff; charset=us-asciiDownload
From c7bf0bcc61647c47f163e009a878a69163e532fb Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 23 Mar 2021 13:39:36 -0500
Subject: [PATCH 07/32] doc review: Pass all scan keys to BRIN consistent
 function at once

commit a1c649d889bdf6e74e9382e1e28574d7071568de
---
 doc/src/sgml/brin.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index d2f12bb605..d2476481af 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -833,7 +833,7 @@ typedef struct BrinOpcInfo
       Returns whether all the ScanKey entries are consistent with the given
       indexed values for a range.
       The attribute number to use is passed as part of the scan key.
-      Multiple scan keys for the same attribute may be passed at once, the
+      Multiple scan keys for the same attribute may be passed at once; the
       number of entries is determined by the <literal>nkeys</literal> parameter.
      </para>
     </listitem>
-- 
2.17.0

0023-accessmtd.patchtext/x-diff; charset=us-asciiDownload
From 83f9954468815f66096a57ad6b2cdb1bba556c1b Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 27 Feb 2021 22:59:45 -0600
Subject: [PATCH 23/32] accessmtd

---
 src/backend/catalog/heap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 9f6303266f..ba03e8aa8f 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -1119,6 +1119,7 @@ AddNewRelationType(const char *typeName,
  *	reltypeid: OID to assign to rel's rowtype, or InvalidOid to select one
  *	reloftypeid: if a typed table, OID of underlying type; else InvalidOid
  *	ownerid: OID of new rel's owner
+ *	accessmtd: OID of new rel's access method
  *	tupdesc: tuple descriptor (source of column definitions)
  *	cooked_constraints: list of precooked check constraints and defaults
  *	relkind: relkind for new rel
-- 
2.17.0

0024-docs-review-logical-replication.patchtext/x-diff; charset=us-asciiDownload
From f24c2c1075706680a64bc7ccaab43b51f98bf66a Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 28 Feb 2021 21:07:23 -0600
Subject: [PATCH 24/32] docs review: logical replication

665d1fad99e7b11678b0d5fa24d2898424243cd6
8af3c233e423e106a5121000ecd92abf57c11704
---
 doc/src/sgml/config.sgml              |  2 +-
 doc/src/sgml/logical-replication.sgml | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index a382258aee..bc4a8b2279 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -4137,7 +4137,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
          On the subscriber side, specifies how many replication origins (see
          <xref linkend="replication-origins"/>) can be tracked simultaneously,
          effectively limiting how many logical replication subscriptions can
-         be created on the server. Setting it a lower value than the current
+         be created on the server. Setting it to a lower value than the current
          number of tracked replication origins (reflected in
          <link linkend="view-pg-replication-origin-status">pg_replication_origin_status</link>,
          not <link linkend="catalog-pg-replication-origin">pg_replication_origin</link>)
diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index 3fad5f34e6..7645ee032c 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -602,13 +602,12 @@
   </para>
 
   <para>
-   The subscriber also requires the <varname>max_replication_slots</varname>
-   be set to configure how many replication origins can be tracked.  In this
-   case it should be set to at least the number of subscriptions that will be
-   added to the subscriber, plus some reserve for table synchronization.
-   <varname>max_logical_replication_workers</varname> must be set to at least
-   the number of subscriptions, again plus some reserve for the table
-   synchronization.  Additionally the <varname>max_worker_processes</varname>
+   <varname>max_replication_slots</varname> must also be set on the subscriber.
+   It should be set to at least the number of
+   subscriptions that will be added to the subscriber, plus some reserve for
+   table synchronization.  <varname>max_logical_replication_workers</varname>
+   must be set to at least the number of subscriptions, again plus some reserve
+   for the table synchronization.  Additionally the <varname>max_worker_processes</varname>
    may need to be adjusted to accommodate for replication workers, at least
    (<varname>max_logical_replication_workers</varname>
    + <literal>1</literal>).  Note that some extensions and parallel queries
-- 
2.17.0

0008-doc-review-Add-pg_amcheck-a-CLI-for-contrib-amcheck.patchtext/x-diff; charset=us-asciiDownload
From 4bbf35a579035c0e8dd1531f47631eb784d40347 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 23 Mar 2021 14:03:28 -0500
Subject: [PATCH 08/32] doc review: Add pg_amcheck, a CLI for contrib/amcheck.

9706092839db2c8c93860674e426a917635438c3
---
 doc/src/sgml/ref/pg_amcheck.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/pg_amcheck.sgml b/doc/src/sgml/ref/pg_amcheck.sgml
index fcc96b430a..d01e26faa8 100644
--- a/doc/src/sgml/ref/pg_amcheck.sgml
+++ b/doc/src/sgml/ref/pg_amcheck.sgml
@@ -460,7 +460,7 @@ PostgreSQL documentation
      <term><option>--skip=<replaceable class="parameter">option</replaceable></option></term>
      <listitem>
       <para>
-       If <literal>"all-frozen"</literal> is given, table corruption checks
+       If <literal>all-frozen</literal> is given, table corruption checks
        will skip over pages in all tables that are marked as all frozen.
       </para>
       <para>
-- 
2.17.0

0009-doc-review-Be-clear-about-whether-a-recovery-pause-h.patchtext/x-diff; charset=us-asciiDownload
From 6e0c552d1c7ad649f90335cd014746238485afe5 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 23 Mar 2021 14:20:31 -0500
Subject: [PATCH 09/32] doc review: Be clear about whether a recovery pause has
 taken effect.

32fd2b57d7f64948e649fc205c43f007762ecaac
---
 doc/src/sgml/func.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 0606b6a9aa..7b75e0bca2 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -25576,7 +25576,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup());
         Returns recovery pause state.  The return values are <literal>
         not paused</literal> if pause is not requested, <literal>
         pause requested</literal> if pause is requested but recovery is
-        not yet paused and, <literal>paused</literal> if the recovery is
+        not yet paused, and <literal>paused</literal> if the recovery is
         actually paused.
        </para></entry>
       </row>
-- 
2.17.0

0010-doc-review-Track-total-amounts-of-times-spent-writin.patchtext/x-diff; charset=us-asciiDownload
From e53ac30d44f66466bbf351ddc2c01f46c836433c Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 23 Mar 2021 14:25:33 -0500
Subject: [PATCH 10/32] doc review: Track total amounts of times spent writing
 and syncing WAL data to disk.

ff99918c625a84c91e7391db9032112ec8653623
---
 doc/src/sgml/wal.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml
index 0f13c43095..24cf567ee2 100644
--- a/doc/src/sgml/wal.sgml
+++ b/doc/src/sgml/wal.sgml
@@ -797,7 +797,7 @@
    <literal>fsync</literal>, or <literal>fsync_writethrough</literal>,
    the write operation moves WAL buffers to kernel cache and
    <function>issue_xlog_fsync</function> syncs them to disk. Regardless
-   of the setting of <varname>track_wal_io_timing</varname>, the numbers
+   of the setting of <varname>track_wal_io_timing</varname>, the number
    of times <function>XLogWrite</function> writes and
    <function>issue_xlog_fsync</function> syncs WAL data to disk are also
    counted as <literal>wal_write</literal> and <literal>wal_sync</literal>
-- 
2.17.0

0011-doc-review-BRIN-minmax-multi-indexes.patchtext/x-diff; charset=us-asciiDownload
From 95a43e5c2d7106f220823f679c36ce4c79e4be47 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 26 Mar 2021 23:14:57 -0500
Subject: [PATCH 11/32] doc review: BRIN minmax-multi indexes

ab596105b55f1d7fbd5a66b66f65227d210b047d
---
 doc/src/sgml/brin.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index d2476481af..ce7c210575 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -730,7 +730,7 @@ LOG:  request for BRIN range summarization for index "brin_wi_idx" page 128 was
      for <xref linkend="sql-altertable"/>. When set to a positive value,
      each block range is assumed to contain this number of distinct non-null
      values. When set to a negative value, which must be greater than or
-     equal to -1, the number of distinct non-null is assumed linear with
+     equal to -1, the number of distinct non-null values is assumed to grow linearly with
      the maximum possible number of tuples in the block range (about 290
      rows per block). The default value is <literal>-0.1</literal>, and
      the minimum number of distinct non-null values is <literal>16</literal>.
@@ -1214,7 +1214,7 @@ typedef struct BrinOpcInfo
 
  <para>
   The minmax-multi operator class is also intended for data types implementing
-  a totally ordered sets, and may be seen as a simple extension of the minmax
+  a totally ordered set, and may be seen as a simple extension of the minmax
   operator class. While minmax operator class summarizes values from each block
   range into a single contiguous interval, minmax-multi allows summarization
   into multiple smaller intervals to improve handling of outlier values.
-- 
2.17.0

0012-doc-review-postgres_fdw-Add-option-to-control-whethe.patchtext/x-diff; charset=us-asciiDownload
From 491445e3c9eb9812fa4635051159082550b6820c Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 2 Apr 2021 09:03:45 -0500
Subject: [PATCH 12/32] doc review: postgres_fdw: Add option to control whether
 to keep connections open.

b1be3074ac719ce8073fba35d4c8b52fb4ddd0c3
---
 doc/src/sgml/postgres-fdw.sgml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/postgres-fdw.sgml b/doc/src/sgml/postgres-fdw.sgml
index fd34956936..e8cb679164 100644
--- a/doc/src/sgml/postgres-fdw.sgml
+++ b/doc/src/sgml/postgres-fdw.sgml
@@ -551,8 +551,8 @@ OPTIONS (ADD password_required 'false');
     <title>Connection Management Options</title>
 
     <para>
-     By default all the open connections that <filename>postgres_fdw</filename>
-     established to the foreign servers are kept in local session for re-use.
+     By default, all connections that <filename>postgres_fdw</filename>
+     establishes to foreign servers are kept open for re-use in the local session.
     </para>
  
     <variablelist>
@@ -562,11 +562,11 @@ OPTIONS (ADD password_required 'false');
       <listitem>
        <para>
         This option controls whether <filename>postgres_fdw</filename> keeps
-        the connections to the foreign server open so that the subsequent
+        the connections to the foreign server open so that subsequent
         queries can re-use them. It can only be specified for a foreign server.
         The default is <literal>on</literal>. If set to <literal>off</literal>,
         all connections to this foreign server will be discarded at the end of
-        transaction.
+        each transaction.
       </para>
       </listitem>
      </varlistentry>
-- 
2.17.0

0013-doc-review-Add-unistr-function.patchtext/x-diff; charset=us-asciiDownload
From dfdae1597d1af5de54a644e6097efa5dd3d7790f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 2 Apr 2021 09:30:58 -0500
Subject: [PATCH 13/32] doc review: Add unistr function

commit f37fec837ce8bf7af408ba66d32099e5a0182402
---
 doc/src/sgml/func.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 7b75e0bca2..be22f4b61b 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -3560,7 +3560,7 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
         <returnvalue>text</returnvalue>
        </para>
        <para>
-        Evaluate escaped Unicode characters in argument.  Unicode characters
+        Evaluate escaped Unicode characters in the argument.  Unicode characters
         can be specified as
         <literal>\<replaceable>XXXX</replaceable></literal> (4 hexadecimal
         digits), <literal>\+<replaceable>XXXXXX</replaceable></literal> (6
-- 
2.17.0

0014-doc-review-Stop-archive-recovery-if-WAL-generated-wi.patchtext/x-diff; charset=us-asciiDownload
From 85330eeda727a0fe151e459970652e30b10c4ca6 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 6 Apr 2021 10:22:35 -0500
Subject: [PATCH 14/32] doc review: Stop archive recovery if WAL generated with
 wal_level=minimal is found.

9de9294b0c4dac77edb80f029648afca79d14653
---
 doc/src/sgml/config.sgml  | 2 +-
 doc/src/sgml/perform.sgml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 26628f3e6d..ae1a38b8bc 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -2723,7 +2723,7 @@ include_dir 'conf.d'
         Note that changing <varname>wal_level</varname> to
         <literal>minimal</literal> makes any base backups taken before
         unavailable for archive recovery and standby server, which may
-        lead to database loss.
+        lead to data loss.
        </para>
        <para>
         In <literal>logical</literal> level, the same information is logged as
diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml
index e0d3f246e9..d1af624f44 100644
--- a/doc/src/sgml/perform.sgml
+++ b/doc/src/sgml/perform.sgml
@@ -1747,7 +1747,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
     <xref linkend="guc-max-wal-senders"/> to zero.
     But note that changing these settings requires a server restart,
     and makes any base backups taken before unavailable for archive
-    recovery and standby server, which may lead to database loss.
+    recovery and standby server, which may lead to data loss.
    </para>
 
    <para>
-- 
2.17.0

0015-doc-review-Add-function-to-log-the-memory-contexts-o.patchtext/x-diff; charset=us-asciiDownload
From e292ee3e350732ea37b98040774123bc61754e08 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 6 Apr 2021 10:27:46 -0500
Subject: [PATCH 15/32] doc review: Add function to log the memory contexts of
 specified backend process.

commit 43620e328617c1f41a2a54c8cee01723064e3ffa
---
 doc/src/sgml/func.sgml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index be22f4b61b..679738f615 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -24926,12 +24926,12 @@ SELECT collation for ('foo' COLLATE "de_DE");
         <returnvalue>boolean</returnvalue>
        </para>
        <para>
-        Requests to log the memory contexts whose backend process has
-        the specified process ID.  These memory contexts will be logged at
+        Requests to log the memory contexts of the backend with the
+        specified process ID.  These memory contexts will be logged at
         <literal>LOG</literal> message level. They will appear in
         the server log based on the log configuration set
         (See <xref linkend="runtime-config-logging"/> for more information),
-        but will not be sent to the client whatever the setting of
+        but will not be sent to the client regardless of
         <xref linkend="guc-client-min-messages"/>.
         Only superusers can request to log the memory contexts.
        </para></entry>
@@ -25037,9 +25037,9 @@ SELECT collation for ('foo' COLLATE "de_DE");
 
    <para>
     <function>pg_log_backend_memory_contexts</function> can be used
-    to log the memory contexts of the backend process. For example,
+    to log the memory contexts of a backend process. For example,
 <programlisting>
-postgres=# SELECT pg_log_backend_memory_contexts(pg_backend_pid());
+postgres=# SELECT pg_log_backend_memory_contexts(pg_backend_pid()); -- XXX
  pg_log_backend_memory_contexts 
 --------------------------------
  t
@@ -25061,8 +25061,8 @@ LOG:  level: 1; TransactionAbortContext: 32768 total in 1 blocks; 32504 free (0
 LOG:  level: 1; ErrorContext: 8192 total in 1 blocks; 7928 free (3 chunks); 264 used
 LOG:  Grand total: 1651920 bytes in 201 blocks; 622360 free (88 chunks); 1029560 used
 </screen>
-    For more than 100 child contexts under the same parent one,
-    100 child contexts and a summary of the remaining ones will be logged.
+    If there are more than 100 child contexts under the same parent, the first
+    100 child contexts are logged, along with a summary of the remaining contexts.
     Note that frequent calls to this function could incur significant overhead,
     because it may generate a large number of log messages.
    </para>
-- 
2.17.0

0016-doc-review-Move-pg_stat_statements-query-jumbling-to.patchtext/x-diff; charset=us-asciiDownload
From 567b33c755ad551858fa014eca868c5ca82e4a5a Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 7 Apr 2021 23:12:50 -0500
Subject: [PATCH 16/32] doc review: Move pg_stat_statements query jumbling to
 core.

5fd9dfa5f50e4906c35133a414ebec5b6d518493
---
 doc/src/sgml/config.sgml           | 2 +-
 doc/src/sgml/pgstatstatements.sgml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index ae1a38b8bc..04712769ca 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -7737,7 +7737,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
        </para>
        <note>
         <para>
-         To ensure that a only one query identifier is calculated and
+         To ensure that only one query identifier is calculated and
          displayed, extensions that calculate query identifiers should
          throw an error if a query identifier has already been computed.
         </para>
diff --git a/doc/src/sgml/pgstatstatements.sgml b/doc/src/sgml/pgstatstatements.sgml
index 5ad4f0aed2..e235504e9a 100644
--- a/doc/src/sgml/pgstatstatements.sgml
+++ b/doc/src/sgml/pgstatstatements.sgml
@@ -406,7 +406,7 @@
   <note>
    <para>
     The following details about constant replacement and
-    <structfield>queryid</structfield> only applies when <xref
+    <structfield>queryid</structfield> only apply when <xref
     linkend="guc-compute-query-id"/> is enabled.  If you use an external
     module instead to compute <structfield>queryid</structfield>, you
     should refer to its documentation for details.
-- 
2.17.0

0017-doc-review-Make-use-of-in-core-query-id-added-by-com.patchtext/x-diff; charset=us-asciiDownload
From 3399caf1335e9ba70d2130599772922a42e4065b Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 7 Apr 2021 23:15:37 -0500
Subject: [PATCH 17/32] doc review: Make use of in-core query id added by
 commit 5fd9dfa5f5

4f0b0966c866ae9f0e15d7cc73ccf7ce4e1af84b
---
 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 04712769ca..cf4e82e8b5 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -7732,7 +7732,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
         The <xref linkend="pgstatstatements"/> extension also requires a query
         identifier to be computed.  Note that an external module can
         alternatively be used if the in-core query identifier computation
-        specification isn't acceptable.  In this case, in-core computation
+        method isn't acceptable.  In this case, in-core computation
         must be disabled.  The default is <literal>off</literal>.
        </para>
        <note>
-- 
2.17.0

0018-doc-review-Fix-use-of-cursor-sensitivity-terminology.patchtext/x-diff; charset=us-asciiDownload
From 69e597176bade9c1a5612d70b8a429f38c3c91e2 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 7 Apr 2021 23:19:22 -0500
Subject: [PATCH 18/32] doc review: Fix use of cursor sensitivity terminology

dd13ad9d39a1ba41cf329b6fe408b49be57c7b88
---
 doc/src/sgml/ref/declare.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/declare.sgml b/doc/src/sgml/ref/declare.sgml
index 8a2b8cc892..aa3d1d1fa1 100644
--- a/doc/src/sgml/ref/declare.sgml
+++ b/doc/src/sgml/ref/declare.sgml
@@ -335,7 +335,7 @@ DECLARE liahona CURSOR FOR SELECT * FROM films;
   <para>
    According to the SQL standard, changes made to insensitive cursors by
    <literal>UPDATE ... WHERE CURRENT OF</literal> and <literal>DELETE
-   ... WHERE CURRENT OF</literal> statements are visibible in that same
+   ... WHERE CURRENT OF</literal> statements are visible in that same
    cursor.  <productname>PostgreSQL</productname> treats these statements like
    all other data changing statements in that they are not visible in
    insensitive cursors.
-- 
2.17.0

0019-spell-vacuum.patchtext/x-diff; charset=us-asciiDownload
From d987f0505e3e3323a7077692d0ae0fff7b3395dd Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 26 Feb 2021 20:47:28 -0600
Subject: [PATCH 19/32] spell: vacuum

c8e0f6bbdb5ff0f235246af5b567b21dcfc1d22a
---
 doc/src/sgml/ref/create_table.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml
index 44e50620fd..d7fffddbce 100644
--- a/doc/src/sgml/ref/create_table.sgml
+++ b/doc/src/sgml/ref/create_table.sgml
@@ -1520,7 +1520,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
     </listitem>
    </varlistentry>
 
-   <varlistentry id="reloption-autovacuum-vauum-scale-factor" xreflabel="autovacuum_vacuum_scale_factor">
+   <varlistentry id="reloption-autovacuum-vacuum-scale-factor" xreflabel="autovacuum_vacuum_scale_factor">
     <term><literal>autovacuum_vacuum_scale_factor</literal>, <literal>toast.autovacuum_vacuum_scale_factor</literal> (<type>floating point</type>)
     <indexterm>
      <primary><varname>autovacuum_vacuum_scale_factor</varname> </primary>
@@ -1610,7 +1610,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
     </listitem>
    </varlistentry>
 
-   <varlistentry id="reloption-autovacuum-vauum-cost-limit" xreflabel="autovacuum_vacuum_cost_limit">
+   <varlistentry id="reloption-autovacuum-vacuum-cost-limit" xreflabel="autovacuum_vacuum_cost_limit">
     <term><literal>autovacuum_vacuum_cost_limit</literal>, <literal>toast.autovacuum_vacuum_cost_limit</literal> (<type>integer</type>)
     <indexterm>
      <primary><varname>autovacuum_vacuum_cost_limit</varname></primary>
-- 
2.17.0

0020-amcheck.patchtext/x-diff; charset=us-asciiDownload
From e6025e2e8163bd045422cd41403722268f6063b1 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 11 Feb 2021 22:34:47 -0600
Subject: [PATCH 20/32] amcheck

---
 doc/src/sgml/amcheck.sgml | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/doc/src/sgml/amcheck.sgml b/doc/src/sgml/amcheck.sgml
index a2571d33ae..30fcb033e3 100644
--- a/doc/src/sgml/amcheck.sgml
+++ b/doc/src/sgml/amcheck.sgml
@@ -457,14 +457,13 @@ SET client_min_messages = DEBUG1;
    </listitem>
    <listitem>
     <para>
-     File system or storage subsystem faults where checksums happen to
-     simply not be enabled.
+     File system or storage subsystem faults where checksums are
+     not enabled.
     </para>
     <para>
-     Note that <filename>amcheck</filename> examines a page as represented in some
-     shared memory buffer at the time of verification if there is only a
-     shared buffer hit when accessing the block. Consequently,
-     <filename>amcheck</filename> does not necessarily examine data read from the
+     Note that <filename>amcheck</filename> examines a page as represented in a
+     shared memory buffer at the time of verification.  If the page is cached,
+     <filename>amcheck</filename> will not examine data read from the
      file system at the time of verification. Note that when checksums are
      enabled, <filename>amcheck</filename> may raise an error due to a checksum
      failure when a corrupt block is read into a buffer.
-- 
2.17.0

0021-wal_compression.patchtext/x-diff; charset=us-asciiDownload
From d37a8a04f708bbc2f5db5c68a63bedb59992b0f0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 14 Mar 2021 21:00:20 -0500
Subject: [PATCH 21/32] wal_compression

57aa5b2bb11a4dbfdfc0f92370e0742ae5aa367b

maybe backpatch to 9.6?
---
 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 cf4e82e8b5..a382258aee 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3098,7 +3098,7 @@ include_dir 'conf.d'
       <listitem>
        <para>
         When this parameter is <literal>on</literal>, the <productname>PostgreSQL</productname>
-        server compresses a full page image written to WAL when
+        server compresses full page images written to WAL when
         <xref linkend="guc-full-page-writes"/> is on or during a base backup.
         A compressed page image will be decompressed during WAL replay.
         The default value is <literal>off</literal>.
-- 
2.17.0

0022-language-fixen.patchtext/x-diff; charset=us-asciiDownload
From 573eeb8666ebfde31b47f7bd2f39c270a2b07c16 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 28 Feb 2021 18:24:09 -0600
Subject: [PATCH 22/32] language fixen

---
 doc/src/sgml/maintenance.sgml    | 2 +-
 doc/src/sgml/perform.sgml        | 2 +-
 doc/src/sgml/ref/createuser.sgml | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml
index 3bbae6dd91..4adb34a21b 100644
--- a/doc/src/sgml/maintenance.sgml
+++ b/doc/src/sgml/maintenance.sgml
@@ -185,7 +185,7 @@
     never issue <command>VACUUM FULL</command>.  In this approach, the idea
     is not to keep tables at their minimum size, but to maintain steady-state
     usage of disk space: each table occupies space equivalent to its
-    minimum size plus however much space gets used up between vacuumings.
+    minimum size plus however much space gets used up between vacuum runs.
     Although <command>VACUUM FULL</command> can be used to shrink a table back
     to its minimum size and return the disk space to the operating system,
     there is not much point in this if the table will just grow again in the
diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml
index d1af624f44..89ff58338e 100644
--- a/doc/src/sgml/perform.sgml
+++ b/doc/src/sgml/perform.sgml
@@ -1899,7 +1899,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
     much faster.  The following are configuration changes you can make
     to improve performance in such cases.  Except as noted below, durability
     is still guaranteed in case of a crash of the database software;
-    only abrupt operating system stoppage creates a risk of data loss
+    only an abrupt operating system crash creates a risk of data loss
     or corruption when these settings are used.
 
     <itemizedlist>
diff --git a/doc/src/sgml/ref/createuser.sgml b/doc/src/sgml/ref/createuser.sgml
index 4d60dc2cda..17579e50af 100644
--- a/doc/src/sgml/ref/createuser.sgml
+++ b/doc/src/sgml/ref/createuser.sgml
@@ -44,7 +44,7 @@ PostgreSQL documentation
    If you wish to create a new superuser, you must connect as a
    superuser, not merely with <literal>CREATEROLE</literal> privilege.
    Being a superuser implies the ability to bypass all access permission
-   checks within the database, so superuserdom should not be granted lightly.
+   checks within the database, so superuser access should not be granted lightly.
   </para>
 
   <para>
-- 
2.17.0

0025-rebuilt.patchtext/x-diff; charset=us-asciiDownload
From a45af383aeb7fb7e19125abd316fb0307eedc349 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 8 Mar 2021 01:40:45 -0600
Subject: [PATCH 25/32] rebuilt

af2543e884db06c0beb75010218cd88680203b86
---
 src/backend/commands/cluster.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index 096a06f7b3..6487a9e3fc 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -1422,7 +1422,7 @@ finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
 								 PROGRESS_CLUSTER_PHASE_FINAL_CLEANUP);
 
 	/*
-	 * If the relation being rebuild is pg_class, swap_relation_files()
+	 * If the relation being rebuilt is pg_class, swap_relation_files()
 	 * couldn't update pg_class's own pg_class entry (check comments in
 	 * swap_relation_files()), thus relfrozenxid was not updated. That's
 	 * annoying because a potential reason for doing a VACUUM FULL is a
-- 
2.17.0

0026-exist.patchtext/x-diff; charset=us-asciiDownload
From 9f78de50426c6ea37f19de001fddc1967c175ba7 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 13 Mar 2021 19:36:23 -0600
Subject: [PATCH 26/32] exist

5f8727f5a679452f7bbdd6966a1586934dcaa84f
---
 src/backend/commands/analyze.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index 5bdaceefd5..182a133033 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -617,7 +617,7 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
 	 *
 	 * We assume that VACUUM hasn't set pg_class.reltuples already, even
 	 * during a VACUUM ANALYZE.  Although VACUUM often updates pg_class,
-	 * exceptions exists.  A "VACUUM (ANALYZE, INDEX_CLEANUP OFF)" command
+	 * exceptions exist.  A "VACUUM (ANALYZE, INDEX_CLEANUP OFF)" command
 	 * will never update pg_class entries for index relations.  It's also
 	 * possible that an individual index's pg_class entry won't be updated
 	 * during VACUUM if the index AM returns NULL from its amvacuumcleanup()
-- 
2.17.0

0027-as.patchtext/x-diff; charset=us-asciiDownload
From 9acedbd4af513ad1a985ff1a33be480f96ccbc4c Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 14 Mar 2021 14:02:26 -0500
Subject: [PATCH 27/32] as

86b85044e823a304d2a265abc030254d39efe7df
---
 src/backend/commands/copyfrom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/commands/copyfrom.c b/src/backend/commands/copyfrom.c
index 20e7d57d41..40a54ad0bd 100644
--- a/src/backend/commands/copyfrom.c
+++ b/src/backend/commands/copyfrom.c
@@ -410,7 +410,7 @@ CopyMultiInsertBufferCleanup(CopyMultiInsertInfo *miinfo,
  * Once flushed we also trim the tracked buffers list down to size by removing
  * the buffers created earliest first.
  *
- * Callers should pass 'curr_rri' is the ResultRelInfo that's currently being
+ * Callers should pass 'curr_rri' as the ResultRelInfo that's currently being
  * used.  When cleaning up old buffers we'll never remove the one for
  * 'curr_rri'.
  */
-- 
2.17.0

0028-Caller.patchtext/x-diff; charset=us-asciiDownload
From ad5f9a20232741e9d091df2e7968084bf4fc6a20 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 14 Mar 2021 13:16:00 -0500
Subject: [PATCH 28/32] Caller

81fcc72e66222357f9bccce3eeda62eb2cb29849
---
 src/backend/utils/adt/jsonfuncs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c
index 9961d27df4..09fcff6729 100644
--- a/src/backend/utils/adt/jsonfuncs.c
+++ b/src/backend/utils/adt/jsonfuncs.c
@@ -1651,7 +1651,7 @@ push_null_elements(JsonbParseState **ps, int num)
  * this path. E.g. the path [a][0][b] with the new value 1 will produce the
  * structure {a: [{b: 1}]}.
  *
- * Called is responsible to make sure such path does not exist yet.
+ * Caller is responsible to make sure such path does not exist yet.
  */
 static void
 push_path(JsonbParseState **st, int level, Datum *path_elems,
@@ -4887,7 +4887,7 @@ IteratorConcat(JsonbIterator **it1, JsonbIterator **it2,
  * than just one last element, this flag will instruct to create the whole
  * chain of corresponding objects and insert the value.
  *
- * JB_PATH_CONSISTENT_POSITION for an array indicates that the called wants to
+ * JB_PATH_CONSISTENT_POSITION for an array indicates that the caller wants to
  * keep values with fixed indices. Indices for existing elements could be
  * changed (shifted forward) in case if the array is prepended with a new value
  * and a negative index out of the range, so this behavior will be prevented
-- 
2.17.0

0029-guc.h-remove-mention-of-doit.patchtext/x-diff; charset=us-asciiDownload
From e7d5c5d9dc60b1b7ebed9d4d4cb0f24ce4049354 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 20 Mar 2021 17:25:01 -0500
Subject: [PATCH 29/32] guc.h: remove mention of "doit"

Gone since 10 years.
2594cf0e8c04406ffff19b1651c5a406d376657c
---
 src/include/utils/guc.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h
index 1892c7927b..1126b34798 100644
--- a/src/include/utils/guc.h
+++ b/src/include/utils/guc.h
@@ -90,8 +90,7 @@ typedef enum
  * dividing line between "interactive" and "non-interactive" sources for
  * error reporting purposes.
  *
- * PGC_S_TEST is used when testing values to be used later ("doit" will always
- * be false, so this never gets stored as the actual source of any value).
+ * PGC_S_TEST is used when testing values to be used later.
  * For example, ALTER DATABASE/ROLE tests proposed per-database or per-user
  * defaults this way, and CREATE FUNCTION tests proposed function SET clauses
  * this way.  This is an interactive case, but it needs its own source value
-- 
2.17.0

0030-a-statistics-objects.patchtext/x-diff; charset=us-asciiDownload
From b745e9e60e3360c3927ced177f445ec883aa8e64 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 24 Mar 2021 18:42:00 -0500
Subject: [PATCH 30/32] a statistics objects

commit d06215d03b50c264a0f31e335b895ee1b6753e68
---
 src/backend/statistics/extended_stats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index 463d44a68a..4674168ff8 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -254,7 +254,7 @@ BuildRelationExtStatistics(Relation onerel, double totalrows,
  * that would require additional columns.
  *
  * See statext_compute_stattarget for details about how we compute statistics
- * target for a statistics objects (from the object target, attribute targets
+ * target for a statistics object (from the object target, attribute targets
  * and default statistics target).
  */
 int
-- 
2.17.0

0031-pg_amcheck-remove-Double-semi-colon.patchtext/x-diff; charset=us-asciiDownload
From e7c370c7c511d73150eca489bf6d8c43a2ffc471 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 30 Mar 2021 23:37:08 -0500
Subject: [PATCH 31/32] pg_amcheck: remove Double semi-colon

commit 9706092839db2c8c93860674e426a917635438c3

Reminicent of 13cb5bd84, 37c99d304
---
 src/bin/pg_amcheck/t/004_verify_heapam.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/pg_amcheck/t/004_verify_heapam.pl b/src/bin/pg_amcheck/t/004_verify_heapam.pl
index 36607596b1..2171d236a7 100644
--- a/src/bin/pg_amcheck/t/004_verify_heapam.pl
+++ b/src/bin/pg_amcheck/t/004_verify_heapam.pl
@@ -175,7 +175,7 @@ sub write_tuple
 	seek($fh, $offset, 0)
 		or BAIL_OUT("seek failed: $!");
 	defined(syswrite($fh, $buffer, HEAPTUPLE_PACK_LENGTH))
-		or BAIL_OUT("syswrite failed: $!");;
+		or BAIL_OUT("syswrite failed: $!");
 	return;
 }
 
-- 
2.17.0

0032-duplicate-words.patchtext/x-diff; charset=us-asciiDownload
From 29c8d614c386691154f1a4db6bebbe0fa7063916 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 4 Apr 2021 13:36:07 -0500
Subject: [PATCH 32/32] duplicate words

0a1f1d3cac6baaa3744b89336673caba702f7628
---
 src/include/lib/sort_template.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/lib/sort_template.h b/src/include/lib/sort_template.h
index 771c789ced..24d6d0006c 100644
--- a/src/include/lib/sort_template.h
+++ b/src/include/lib/sort_template.h
@@ -241,7 +241,7 @@ ST_SCOPE void ST_SORT(ST_ELEMENT_TYPE *first, size_t n
 
 /*
  * Find the median of three values.  Currently, performance seems to be best
- * if the the comparator is inlined here, but the med3 function is not inlined
+ * if the comparator is inlined here, but the med3 function is not inlined
  * in the qsort function.
  */
 static pg_noinline ST_ELEMENT_TYPE *
-- 
2.17.0

#31Michael Paquier
michael@paquier.xyz
In reply to: Justin Pryzby (#30)
Re: doc review for v14

On Thu, Apr 08, 2021 at 11:40:08AM -0500, Justin Pryzby wrote:

Another round of doc review, not yet including all of yesterday's commits.

Thanks for compiling all that. I got through the whole set and
applied the most relevant parts on HEAD. Some of them applied down to
9.6, so I have fixed it down where needed, for the parts that did not
conflict too heavily.
--
Michael

#32Justin Pryzby
pryzby@telsasoft.com
In reply to: Michael Paquier (#31)
7 attachment(s)
Re: doc review for v14

On Fri, Apr 09, 2021 at 02:03:27PM +0900, Michael Paquier wrote:

On Thu, Apr 08, 2021 at 11:40:08AM -0500, Justin Pryzby wrote:

Another round of doc review, not yet including all of yesterday's commits.

Thanks for compiling all that. I got through the whole set and
applied the most relevant parts on HEAD. Some of them applied down to
9.6, so I have fixed it down where needed, for the parts that did not
conflict too heavily.

Thanks. Rebased with remaining, queued fixes.

--
Justin

Attachments:

0001-doc-review-Add-support-for-PROVE_TESTS-and-PROVE_FLA.patchtext/x-diff; charset=us-asciiDownload
From 58b6a3ae7d76f6160bc7ad531f400da2fe0710eb Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 4 Mar 2021 19:32:05 -0600
Subject: [PATCH 1/7] doc review: Add support for PROVE_TESTS and PROVE_FLAGS
 in MSVC scripts

5bca69a76b3046a85c60c48271c1831fd5affa51
---
 doc/src/sgml/install-windows.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml
index 64687b12e6..cb6bb05dc5 100644
--- a/doc/src/sgml/install-windows.sgml
+++ b/doc/src/sgml/install-windows.sgml
@@ -499,8 +499,8 @@ $ENV{PERL5LIB}=$ENV{PERL5LIB} . ';c:\IPC-Run-0.94\lib';
 
   <para>
    The TAP tests run with <command>vcregress</command> support the
-   environment variables <varname>PROVE_TESTS</varname>, that is expanded
-   automatically using the name patterns given, and
+   environment variables <varname>PROVE_TESTS</varname>, which is
+   expanded as a glob pattern, and
    <varname>PROVE_FLAGS</varname>. These can be set on a Windows terminal,
    before running <command>vcregress</command>:
 <programlisting>
-- 
2.17.0

0002-doc-review-Pass-all-scan-keys-to-BRIN-consistent-fun.patchtext/x-diff; charset=us-asciiDownload
From 705507708c977e8172a2e091378099e630bad1b0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 23 Mar 2021 13:39:36 -0500
Subject: [PATCH 2/7] doc review: Pass all scan keys to BRIN consistent
 function at once

commit a1c649d889bdf6e74e9382e1e28574d7071568de
---
 doc/src/sgml/brin.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index d2f12bb605..d2476481af 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -833,7 +833,7 @@ typedef struct BrinOpcInfo
       Returns whether all the ScanKey entries are consistent with the given
       indexed values for a range.
       The attribute number to use is passed as part of the scan key.
-      Multiple scan keys for the same attribute may be passed at once, the
+      Multiple scan keys for the same attribute may be passed at once; the
       number of entries is determined by the <literal>nkeys</literal> parameter.
      </para>
     </listitem>
-- 
2.17.0

0003-doc-review-BRIN-minmax-multi-indexes.patchtext/x-diff; charset=us-asciiDownload
From b9bf3485cbd243bc09fcfd0f043ee8162b779e2f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 26 Mar 2021 23:14:57 -0500
Subject: [PATCH 3/7] doc review: BRIN minmax-multi indexes

ab596105b55f1d7fbd5a66b66f65227d210b047d
---
 doc/src/sgml/brin.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index d2476481af..ce7c210575 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -730,7 +730,7 @@ LOG:  request for BRIN range summarization for index "brin_wi_idx" page 128 was
      for <xref linkend="sql-altertable"/>. When set to a positive value,
      each block range is assumed to contain this number of distinct non-null
      values. When set to a negative value, which must be greater than or
-     equal to -1, the number of distinct non-null is assumed linear with
+     equal to -1, the number of distinct non-null values is assumed to grow linearly with
      the maximum possible number of tuples in the block range (about 290
      rows per block). The default value is <literal>-0.1</literal>, and
      the minimum number of distinct non-null values is <literal>16</literal>.
@@ -1214,7 +1214,7 @@ typedef struct BrinOpcInfo
 
  <para>
   The minmax-multi operator class is also intended for data types implementing
-  a totally ordered sets, and may be seen as a simple extension of the minmax
+  a totally ordered set, and may be seen as a simple extension of the minmax
   operator class. While minmax operator class summarizes values from each block
   range into a single contiguous interval, minmax-multi allows summarization
   into multiple smaller intervals to improve handling of outlier values.
-- 
2.17.0

0004-reltuples-not-relpages-Set-pg_class.reltuples-for-pa.patchtext/x-diff; charset=us-asciiDownload
From 61ee22354dc000000eb60fcbd88d83dbc5b9316f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 10 Apr 2021 20:56:35 -0500
Subject: [PATCH 4/7] reltuples not relpages: Set pg_class.reltuples for
 partitioned tables

commit 0e69f705cc1a3df273b38c9883fb5765991e04fe
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:   Fri Apr 9 11:29:08 2021 -0400
---
 src/backend/commands/analyze.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index cffcd54302..8aa329a2a0 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -660,7 +660,7 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
 	{
 		/*
 		 * Partitioned tables don't have storage, so we don't set any fields in
-		 * their pg_class entries except for relpages, which is necessary for
+		 * their pg_class entries except for reltuples, which is necessary for
 		 * auto-analyze to work properly.
 		 */
 		vac_update_relstats(onerel, -1, totalrows,
-- 
2.17.0

0005-preprending-Multirange-datatypes.patchtext/x-diff; charset=us-asciiDownload
From 690d1446413fff5fb6eea6c839753aeb3f2846c2 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 12 Apr 2021 23:31:26 -0500
Subject: [PATCH 5/7] preprending: Multirange datatypes

6df7a9698bb036610c1e8c6d375e1be38cb26d5f
---
 src/backend/catalog/pg_type.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/catalog/pg_type.c b/src/backend/catalog/pg_type.c
index ec5d122432..d50db2314e 100644
--- a/src/backend/catalog/pg_type.c
+++ b/src/backend/catalog/pg_type.c
@@ -988,7 +988,7 @@ makeMultirangeTypeName(const char *rangeTypeName, Oid typeNamespace)
  * makeUniqueTypeName
  *		Generate a unique name for a prospective new type
  *
- * Given a typeName, return a new palloc'ed name by preprending underscores
+ * Given a typeName, return a new palloc'ed name by prepending underscores
  * until a non-conflicting name results.
  *
  * If tryOriginal, first try with zero underscores.
-- 
2.17.0

0006-lock-Make-use-of-in-core-query-id-added-by-commit-5f.patchtext/x-diff; charset=us-asciiDownload
From 39cb334d833a65e4ccc8436c76aa6e76b59e44b1 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 8 Apr 2021 00:11:53 -0500
Subject: [PATCH 6/7] lock: Make use of in-core query id added by commit
 5fd9dfa5f5

4f0b0966c866ae9f0e15d7cc73ccf7ce4e1af84b
---
 src/backend/utils/activity/backend_status.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/utils/activity/backend_status.c b/src/backend/utils/activity/backend_status.c
index 6110113e56..5c1b2c25ed 100644
--- a/src/backend/utils/activity/backend_status.c
+++ b/src/backend/utils/activity/backend_status.c
@@ -1032,10 +1032,10 @@ pgstat_get_my_queryid(void)
 	if (!MyBEEntry)
 		return 0;
 
-	/* There's no need for a look around pgstat_begin_read_activity /
+	/* There's no need for a lock around pgstat_begin_read_activity /
 	 * pgstat_end_read_activity here as it's only called from
 	 * pg_stat_get_activity which is already protected, or from the same
-	 * backend which mean that there won't be concurrent write.
+	 * backend which means that there won't be concurrent writes.
 	 */
 	return MyBEEntry->st_queryid;
 }
-- 
2.17.0

0007-WIP-doc-review-Add-DECLARE-STATEMENT-command-to-ECPG.patchtext/x-diff; charset=us-asciiDownload
From c6cb6a73fc5b0c6809f741b2bef7dabb0a854d9c Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 2 Apr 2021 09:23:42 -0500
Subject: [PATCH 7/7] WIP: doc review: Add DECLARE STATEMENT command to ECPG

ad8305a43d1890768a613d3fb586b44f17360f29
---
 doc/src/sgml/ecpg.sgml | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/doc/src/sgml/ecpg.sgml b/doc/src/sgml/ecpg.sgml
index 56f5d9b5db..8f2908823a 100644
--- a/doc/src/sgml/ecpg.sgml
+++ b/doc/src/sgml/ecpg.sgml
@@ -354,14 +354,14 @@ current=testdb1 (should be testdb1)
   </para>
 
   <para>
-  The third option is to declare sql identifier linked to
+  The third option is to declare a SQL identifier linked to
   the connection, for example:
 <programlisting>
 EXEC SQL AT <replaceable>connection-name</replaceable> DECLARE <replaceable>statement-name</replaceable> STATEMENT;
 EXEC SQL PREPARE <replaceable>statement-name</replaceable> FROM :<replaceable>dyn-string</replaceable>;
 </programlisting>
-   Once you link a sql identifier to a connection, you execute a dynamic SQL
-   without AT clause. Note that this option behaves like preprocessor directives,
+   Once you link a SQL identifier to a connection, you execute dynamic SQL
+   without an AT clause. Note that this option behaves like preprocessor directives,
    therefore the link is enabled only in the file.
   </para>
   <para>
@@ -6911,14 +6911,14 @@ EXEC SQL [ AT <replaceable class="parameter">connection_name</replaceable> ] DEC
     <title>Description</title>
 
     <para>
-     <command>DECLARE STATEMENT</command> declares SQL statement identifier.
+     <command>DECLARE STATEMENT</command> declares a SQL statement identifier.
      SQL statement identifier can be associated with the connection.
-     When the identifier is used by dynamic SQL statements, these SQLs are executed
-     by using the associated connection.
+     When the identifier is used by dynamic SQL statements, the statements are executed
+     using the associated connection.
      The namespace of the declaration is the precompile unit, and multiple declarations to
-     the same SQL statement identifier is not allowed.
+     the same SQL statement identifier are not allowed.
 
-     Note that if the precompiler run in the Informix compatibility mode and some SQL statement
+     Note that if the precompiler runs in Informix compatibility mode and some SQL statement
      is declared, "database" can not be used as a cursor name.
     </para>
    </refsect1>
-- 
2.17.0

#33Justin Pryzby
pryzby@telsasoft.com
In reply to: Justin Pryzby (#32)
27 attachment(s)
Re: doc review for v14

A bunch more found with things like this.

find src -name '*.c' |xargs grep '^[[:space:]]*/\?\*' |grep -woE '[[:lower:]]{3,8}' |sed 's/.*/\L&/' |
sort |uniq -c |sort -nr |awk '$1==1' |less

Attachments:

0001-doc-review-Add-support-for-PROVE_TESTS-and-PROVE_FLA.patchtext/x-diff; charset=us-asciiDownload
From 9fd5e2797efc14f83bfb2d47d5174de81a34ac6e Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 4 Mar 2021 19:32:05 -0600
Subject: [PATCH 01/27] doc review: Add support for PROVE_TESTS and PROVE_FLAGS
 in MSVC scripts

5bca69a76b3046a85c60c48271c1831fd5affa51
---
 doc/src/sgml/install-windows.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml
index 64687b12e6..cb6bb05dc5 100644
--- a/doc/src/sgml/install-windows.sgml
+++ b/doc/src/sgml/install-windows.sgml
@@ -499,8 +499,8 @@ $ENV{PERL5LIB}=$ENV{PERL5LIB} . ';c:\IPC-Run-0.94\lib';
 
   <para>
    The TAP tests run with <command>vcregress</command> support the
-   environment variables <varname>PROVE_TESTS</varname>, that is expanded
-   automatically using the name patterns given, and
+   environment variables <varname>PROVE_TESTS</varname>, which is
+   expanded as a glob pattern, and
    <varname>PROVE_FLAGS</varname>. These can be set on a Windows terminal,
    before running <command>vcregress</command>:
 <programlisting>
-- 
2.17.0

0002-doc-review-Pass-all-scan-keys-to-BRIN-consistent-fun.patchtext/x-diff; charset=us-asciiDownload
From 1392ef571f6afb62f5cd79db691a9c2d2255dde0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 23 Mar 2021 13:39:36 -0500
Subject: [PATCH 02/27] doc review: Pass all scan keys to BRIN consistent
 function at once

commit a1c649d889bdf6e74e9382e1e28574d7071568de
---
 doc/src/sgml/brin.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index d2f12bb605..d2476481af 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -833,7 +833,7 @@ typedef struct BrinOpcInfo
       Returns whether all the ScanKey entries are consistent with the given
       indexed values for a range.
       The attribute number to use is passed as part of the scan key.
-      Multiple scan keys for the same attribute may be passed at once, the
+      Multiple scan keys for the same attribute may be passed at once; the
       number of entries is determined by the <literal>nkeys</literal> parameter.
      </para>
     </listitem>
-- 
2.17.0

0003-doc-review-BRIN-minmax-multi-indexes.patchtext/x-diff; charset=us-asciiDownload
From 1323e85320a0e5414b490ef7f0082f3cca60864c Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 26 Mar 2021 23:14:57 -0500
Subject: [PATCH 03/27] doc review: BRIN minmax-multi indexes

ab596105b55f1d7fbd5a66b66f65227d210b047d
---
 doc/src/sgml/brin.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index d2476481af..ce7c210575 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -730,7 +730,7 @@ LOG:  request for BRIN range summarization for index "brin_wi_idx" page 128 was
      for <xref linkend="sql-altertable"/>. When set to a positive value,
      each block range is assumed to contain this number of distinct non-null
      values. When set to a negative value, which must be greater than or
-     equal to -1, the number of distinct non-null is assumed linear with
+     equal to -1, the number of distinct non-null values is assumed to grow linearly with
      the maximum possible number of tuples in the block range (about 290
      rows per block). The default value is <literal>-0.1</literal>, and
      the minimum number of distinct non-null values is <literal>16</literal>.
@@ -1214,7 +1214,7 @@ typedef struct BrinOpcInfo
 
  <para>
   The minmax-multi operator class is also intended for data types implementing
-  a totally ordered sets, and may be seen as a simple extension of the minmax
+  a totally ordered set, and may be seen as a simple extension of the minmax
   operator class. While minmax operator class summarizes values from each block
   range into a single contiguous interval, minmax-multi allows summarization
   into multiple smaller intervals to improve handling of outlier values.
-- 
2.17.0

0011-rightmost.patchtext/x-diff; charset=us-asciiDownload
From c893f5eb5a7640edb54c39901bdcb158e93ef6d8 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 15 Apr 2021 23:27:06 -0500
Subject: [PATCH 11/27] rightmost

16fa9b2b30a357b4aea982bd878ec2e5e002dbcc
---
 src/backend/access/gist/gistbuild.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/access/gist/gistbuild.c b/src/backend/access/gist/gistbuild.c
index 1054f6f1f2..90ebd41833 100644
--- a/src/backend/access/gist/gistbuild.c
+++ b/src/backend/access/gist/gistbuild.c
@@ -115,7 +115,7 @@ typedef struct
 
 /*
  * In sorted build, we use a stack of these structs, one for each level,
- * to hold an in-memory buffer of the righmost page at the level. When the
+ * to hold an in-memory buffer of the rightmost page at the level. When the
  * page fills up, it is written out and a new page is allocated.
  */
 typedef struct GistSortedBuildPageState
-- 
2.17.0

0004-doc-review-VACUUM-PROCESS_TOAST.patchtext/x-diff; charset=us-asciiDownload
From dbf9f5cd9e2c0d7ee471c29b241ae8d5bc565fd6 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 18 Feb 2021 10:13:15 -0600
Subject: [PATCH 04/27] doc review: VACUUM (PROCESS_TOAST)

7cb3048f38e26b39dd5fd412ed8a4981b6809b35

Michael had some comments here, but it seems to exactly match my existing
language.  https://www.postgresql.org/message-id/YDdaR29pDIXpGTBQ@paquier.xyz
---
 doc/src/sgml/ref/vacuum.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/vacuum.sgml b/doc/src/sgml/ref/vacuum.sgml
index 6a0028a514..949ca23797 100644
--- a/doc/src/sgml/ref/vacuum.sgml
+++ b/doc/src/sgml/ref/vacuum.sgml
@@ -219,7 +219,7 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ ANALYZE ] [ <replaceable class="paramet
       corresponding <literal>TOAST</literal> table for each relation, if one
       exists. This is normally the desired behavior and is the default.
       Setting this option to false may be useful when it is only necessary to
-      vacuum the main relation. This option is required when the
+      vacuum the main relation. This option may not be disabled when the
       <literal>FULL</literal> option is used.
      </para>
     </listitem>
-- 
2.17.0

0005-WIP-doc-review-Add-DECLARE-STATEMENT-command-to-ECPG.patchtext/x-diff; charset=us-asciiDownload
From 0120fa422a89e1d87b3e29ec29f52c5c6379d7ae Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 2 Apr 2021 09:23:42 -0500
Subject: [PATCH 05/27] WIP: doc review: Add DECLARE STATEMENT command to ECPG

declared
ad8305a43d1890768a613d3fb586b44f17360f29
---
 doc/src/sgml/ecpg.sgml             | 16 ++++++++--------
 src/backend/tsearch/spell.c        |  2 +-
 src/interfaces/ecpg/preproc/ecpg.c |  2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/doc/src/sgml/ecpg.sgml b/doc/src/sgml/ecpg.sgml
index 56f5d9b5db..8f2908823a 100644
--- a/doc/src/sgml/ecpg.sgml
+++ b/doc/src/sgml/ecpg.sgml
@@ -354,14 +354,14 @@ current=testdb1 (should be testdb1)
   </para>
 
   <para>
-  The third option is to declare sql identifier linked to
+  The third option is to declare a SQL identifier linked to
   the connection, for example:
 <programlisting>
 EXEC SQL AT <replaceable>connection-name</replaceable> DECLARE <replaceable>statement-name</replaceable> STATEMENT;
 EXEC SQL PREPARE <replaceable>statement-name</replaceable> FROM :<replaceable>dyn-string</replaceable>;
 </programlisting>
-   Once you link a sql identifier to a connection, you execute a dynamic SQL
-   without AT clause. Note that this option behaves like preprocessor directives,
+   Once you link a SQL identifier to a connection, you execute dynamic SQL
+   without an AT clause. Note that this option behaves like preprocessor directives,
    therefore the link is enabled only in the file.
   </para>
   <para>
@@ -6911,14 +6911,14 @@ EXEC SQL [ AT <replaceable class="parameter">connection_name</replaceable> ] DEC
     <title>Description</title>
 
     <para>
-     <command>DECLARE STATEMENT</command> declares SQL statement identifier.
+     <command>DECLARE STATEMENT</command> declares a SQL statement identifier.
      SQL statement identifier can be associated with the connection.
-     When the identifier is used by dynamic SQL statements, these SQLs are executed
-     by using the associated connection.
+     When the identifier is used by dynamic SQL statements, the statements are executed
+     using the associated connection.
      The namespace of the declaration is the precompile unit, and multiple declarations to
-     the same SQL statement identifier is not allowed.
+     the same SQL statement identifier are not allowed.
 
-     Note that if the precompiler run in the Informix compatibility mode and some SQL statement
+     Note that if the precompiler runs in Informix compatibility mode and some SQL statement
      is declared, "database" can not be used as a cursor name.
     </para>
    </refsect1>
diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c
index 68160bd592..ebc89604ac 100644
--- a/src/backend/tsearch/spell.c
+++ b/src/backend/tsearch/spell.c
@@ -2020,7 +2020,7 @@ NISortAffixes(IspellDict *Conf)
 						 (const unsigned char *) Affix->repl,
 						 (ptr - 1)->len))
 			{
-				/* leave only unique and minimals suffixes */
+				/* leave only unique and minimal suffixes */
 				ptr->affix = Affix->repl;
 				ptr->len = Affix->replen;
 				ptr->issuffix = issuffix;
diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c
index ee2fa51588..9d861b428b 100644
--- a/src/interfaces/ecpg/preproc/ecpg.c
+++ b/src/interfaces/ecpg/preproc/ecpg.c
@@ -375,7 +375,7 @@ main(int argc, char *const argv[])
 				}
 				cur = NULL;
 
-				/* remove old delared statements if any are still there */
+				/* remove old declared statements if any are still there */
 				for (list = g_declared_list; list != NULL;)
 				{
 					struct declared_list *this = list;
-- 
2.17.0

0006-BRIN-minmax-multi-indexes-between-procedures-dedupli.patchtext/x-diff; charset=us-asciiDownload
From dc82ab33783e7ed62f0a013fdf3d19a7a2388775 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 16 Apr 2021 01:44:53 -0500
Subject: [PATCH 06/27] BRIN minmax-multi indexes: between / procedures /
 deduplicate

ab596105b55f1d7fbd5a66b66f65227d210b047d
---
 src/backend/access/brin/brin_minmax_multi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backend/access/brin/brin_minmax_multi.c b/src/backend/access/brin/brin_minmax_multi.c
index 4163abef3f..5e4b234cc6 100644
--- a/src/backend/access/brin/brin_minmax_multi.c
+++ b/src/backend/access/brin/brin_minmax_multi.c
@@ -248,7 +248,7 @@ typedef struct DistanceValue
 } DistanceValue;
 
 
-/* Cache for support and strategy procesures. */
+/* Cache for support and strategy procedures. */
 
 static FmgrInfo *minmax_multi_get_procinfo(BrinDesc *bdesc, uint16 attno,
 										   uint16 procnum);
@@ -1311,7 +1311,7 @@ compare_distances(const void *a, const void *b)
 }
 
 /*
- * Given an array of expanded ranges, compute distance of the gaps betwen
+ * Given an array of expanded ranges, compute distance of the gaps between
  * the ranges - for ncranges there are (ncranges-1) gaps.
  *
  * We simply call the "distance" function to compute the (max-min) for pairs
@@ -1623,7 +1623,7 @@ ensure_free_space_in_buffer(BrinDesc *bdesc, Oid colloid,
 	 *
 	 * We don't simply check against range->maxvalues again. The deduplication
 	 * might have freed very little space (e.g. just one value), forcing us to
-	 * do depuplication very often. In that case it's better to do compaction
+	 * do deduplication very often. In that case it's better to do compaction
 	 * and reduce more space.
 	 */
 	if (2 * range->nranges + range->nvalues <= range->maxvalues * MINMAX_BUFFER_LOAD_FACTOR)
-- 
2.17.0

0007-reltuples-not-relpages-Set-pg_class.reltuples-for-pa.patchtext/x-diff; charset=us-asciiDownload
From 35b85c2101211999016c06a32ca58851fc994476 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 10 Apr 2021 20:56:35 -0500
Subject: [PATCH 07/27] reltuples not relpages: Set pg_class.reltuples for
 partitioned tables

commit 0e69f705cc1a3df273b38c9883fb5765991e04fe
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:   Fri Apr 9 11:29:08 2021 -0400
---
 src/backend/commands/analyze.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index cffcd54302..8aa329a2a0 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -660,7 +660,7 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
 	{
 		/*
 		 * Partitioned tables don't have storage, so we don't set any fields in
-		 * their pg_class entries except for relpages, which is necessary for
+		 * their pg_class entries except for reltuples, which is necessary for
 		 * auto-analyze to work properly.
 		 */
 		vac_update_relstats(onerel, -1, totalrows,
-- 
2.17.0

0008-Multirange-datatypes-preprending-multirange.patchtext/x-diff; charset=us-asciiDownload
From 76dd623a432ecc85464be9c57babd7b3b14f61e6 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 12 Apr 2021 23:31:26 -0500
Subject: [PATCH 08/27] Multirange datatypes: preprending / multirange

6df7a9698bb036610c1e8c6d375e1be38cb26d5f
---
 src/backend/catalog/pg_type.c           | 2 +-
 src/backend/utils/adt/multirangetypes.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/catalog/pg_type.c b/src/backend/catalog/pg_type.c
index ec5d122432..d50db2314e 100644
--- a/src/backend/catalog/pg_type.c
+++ b/src/backend/catalog/pg_type.c
@@ -988,7 +988,7 @@ makeMultirangeTypeName(const char *rangeTypeName, Oid typeNamespace)
  * makeUniqueTypeName
  *		Generate a unique name for a prospective new type
  *
- * Given a typeName, return a new palloc'ed name by preprending underscores
+ * Given a typeName, return a new palloc'ed name by prepending underscores
  * until a non-conflicting name results.
  *
  * If tryOriginal, first try with zero underscores.
diff --git a/src/backend/utils/adt/multirangetypes.c b/src/backend/utils/adt/multirangetypes.c
index b3964ea27f..7ba6ff9860 100644
--- a/src/backend/utils/adt/multirangetypes.c
+++ b/src/backend/utils/adt/multirangetypes.c
@@ -553,7 +553,7 @@ multirange_get_typcache(FunctionCallInfo fcinfo, Oid mltrngtypid)
 
 
 /*
- * Estimate size occupied by serialized multirage.
+ * Estimate size occupied by serialized multirange.
  */
 static Size
 multirange_size_estimate(TypeCacheEntry *rangetyp, int32 range_count,
-- 
2.17.0

0009-lock-Make-use-of-in-core-query-id-added-by-commit-5f.patchtext/x-diff; charset=us-asciiDownload
From 699690989468e6d8e9239668689d0eba298d2c2d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 8 Apr 2021 00:11:53 -0500
Subject: [PATCH 09/27] lock: Make use of in-core query id added by commit
 5fd9dfa5f5

4f0b0966c866ae9f0e15d7cc73ccf7ce4e1af84b
---
 src/backend/utils/activity/backend_status.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/utils/activity/backend_status.c b/src/backend/utils/activity/backend_status.c
index 6110113e56..5c1b2c25ed 100644
--- a/src/backend/utils/activity/backend_status.c
+++ b/src/backend/utils/activity/backend_status.c
@@ -1032,10 +1032,10 @@ pgstat_get_my_queryid(void)
 	if (!MyBEEntry)
 		return 0;
 
-	/* There's no need for a look around pgstat_begin_read_activity /
+	/* There's no need for a lock around pgstat_begin_read_activity /
 	 * pgstat_end_read_activity here as it's only called from
 	 * pg_stat_get_activity which is already protected, or from the same
-	 * backend which mean that there won't be concurrent write.
+	 * backend which means that there won't be concurrent writes.
 	 */
 	return MyBEEntry->st_queryid;
 }
-- 
2.17.0

0010-the-GlobalVisTest.patchtext/x-diff; charset=us-asciiDownload
From cb9137b727d8bbee6223ba380680054b2b8a7623 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 15 Apr 2021 23:21:34 -0500
Subject: [PATCH 10/27] the GlobalVisTest

dc7420c2c9274a283779ec19718d2d16323640c0
---
 src/backend/storage/ipc/procarray.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index bf776286de..5ff8cab394 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -2131,7 +2131,7 @@ GetSnapshotDataReuse(Snapshot snapshot)
  *			older than this are known not running any more.
  *
  * And try to advance the bounds of GlobalVis{Shared,Catalog,Data,Temp}Rels
- * for the benefit of theGlobalVisTest* family of functions.
+ * for the benefit of the GlobalVisTest* family of functions.
  *
  * Note: this function should probably not be called with an argument that's
  * not statically allocated (see xip allocation below).
-- 
2.17.0

0012-reader.patchtext/x-diff; charset=us-asciiDownload
From c0f8d94574a18f0556d8d57c3b760d73eb90ccfa Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 15 Apr 2021 23:30:08 -0500
Subject: [PATCH 12/27] reader

323cbe7c7ddcf18aaf24b7f6d682a45a61d4e31b
---
 src/bin/pg_waldump/pg_waldump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/pg_waldump/pg_waldump.c b/src/bin/pg_waldump/pg_waldump.c
index d4d6bb25a9..4ec273e6d2 100644
--- a/src/bin/pg_waldump/pg_waldump.c
+++ b/src/bin/pg_waldump/pg_waldump.c
@@ -323,7 +323,7 @@ WALDumpCloseSegment(XLogReaderState *state)
 }
 
 /*
- * pg_waldump's WAL page rader
+ * pg_waldump's WAL page reader
  *
  * timeline and startptr specifies the LSN, and reads up to endptr.
  */
-- 
2.17.0

0013-performed.patchtext/x-diff; charset=us-asciiDownload
From 040e398e26443af06acc94c33988bbbf02f96c15 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 15 Apr 2021 23:32:22 -0500
Subject: [PATCH 13/27] performed

9c4f5192f69ed16c99e0d079f0b5faebd7bad212
---
 src/bin/pg_rewind/pg_rewind.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/pg_rewind/pg_rewind.c b/src/bin/pg_rewind/pg_rewind.c
index 9df08ab2b0..38e5d23755 100644
--- a/src/bin/pg_rewind/pg_rewind.c
+++ b/src/bin/pg_rewind/pg_rewind.c
@@ -605,7 +605,7 @@ perform_rewind(filemap_t *filemap, rewind_source *source,
 	 * and the target. But if the source is a standby server, it's possible
 	 * that the last common checkpoint is *after* the standby's restartpoint.
 	 * That implies that the source server has applied the checkpoint record,
-	 * but hasn't perfomed a corresponding restartpoint yet. Make sure we
+	 * but hasn't performed a corresponding restartpoint yet. Make sure we
 	 * start at the restartpoint's redo point in that case.
 	 *
 	 * Use the old version of the source's control file for this. The server
-- 
2.17.0

0014-oriented-updatable.patchtext/x-diff; charset=us-asciiDownload
From d06a1bf34f820674ae04a47ccaa5360921796f0d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 15 Apr 2021 23:35:08 -0500
Subject: [PATCH 14/27] oriented / updatable

d168b666823b6e0bcf60ed19ce24fb5fb91b8ccf
---
 doc/src/sgml/config.sgml            | 7 ++++---
 src/backend/access/nbtree/nbtpage.c | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 776ab1a8c8..46e5d29385 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -8241,8 +8241,9 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
         This parameter specifies the default table access method to use when
         creating tables or materialized views if the <command>CREATE</command>
         command does not explicitly specify an access method, or when
-        <command>SELECT ... INTO</command> is used, which does not allow to
-        specify a table access method. The default is <literal>heap</literal>.
+        <command>SELECT ... INTO</command> is used, which does not allow
+        specification of a table access method.
+        The default is <literal>heap</literal>.
        </para>
       </listitem>
      </varlistentry>
@@ -8273,7 +8274,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
        </para>
 
        <para>
-        This variable is not used for temporary tables; for them,
+        This variable is not used for temporary tables, for which
         <xref linkend="guc-temp-tablespaces"/> is consulted instead.
        </para>
 
diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c
index ef48679cc2..706e16ae94 100644
--- a/src/backend/access/nbtree/nbtpage.c
+++ b/src/backend/access/nbtree/nbtpage.c
@@ -1398,7 +1398,7 @@ _bt_delitems_delete(Relation rel, Buffer buf, TransactionId latestRemovedXid,
  * _bt_delitems_delete.  These steps must take place before each function's
  * critical section begins.
  *
- * updatabable and nupdatable are inputs, though note that we will use
+ * updatable and nupdatable are inputs, though note that we will use
  * _bt_update_posting() to replace the original itup with a pointer to a final
  * version in palloc()'d memory.  Caller should free the tuples when its done.
  *
@@ -1504,7 +1504,7 @@ _bt_delitems_cmp(const void *a, const void *b)
  * some extra index tuples that were practically free for tableam to check in
  * passing (when they actually turn out to be safe to delete).  It probably
  * only makes sense for the tableam to go ahead with these extra checks when
- * it is block-orientated (otherwise the checks probably won't be practically
+ * it is block-oriented (otherwise the checks probably won't be practically
  * free, which we rely on).  The tableam interface requires the tableam side
  * to handle the problem, though, so this is okay (we as an index AM are free
  * to make the simplifying assumption that all tableams must be block-based).
-- 
2.17.0

0015-necessary.patchtext/x-diff; charset=us-asciiDownload
From ae655cb6743bad086326df1c9fde355f74c56112 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 15 Apr 2021 23:37:52 -0500
Subject: [PATCH 15/27] necessary

e6bdfd9700ebfc7df811c97c2fc46d7e94e329a2
---
 src/common/hmac_openssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/hmac_openssl.c b/src/common/hmac_openssl.c
index b5e3065d1a..5df06839e0 100644
--- a/src/common/hmac_openssl.c
+++ b/src/common/hmac_openssl.c
@@ -34,7 +34,7 @@
 
 /*
  * In backend, use an allocation in TopMemoryContext to count for resowner
- * cleanup handling if necesary.  For versions of OpenSSL where HMAC_CTX is
+ * cleanup handling if necessary.  For versions of OpenSSL where HMAC_CTX is
  * known, just use palloc().  In frontend, use malloc to be able to return
  * a failure status back to the caller.
  */
-- 
2.17.0

0016-minmax.patchtext/x-diff; charset=us-asciiDownload
From 69e607926e9b93af78c5dcc4ff4366d78403b632 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 15 Apr 2021 23:39:01 -0500
Subject: [PATCH 16/27] minmax

77b88cd1bb9041a735f24072150cacfa06c699a3
---
 src/backend/access/brin/brin_bloom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/access/brin/brin_bloom.c b/src/backend/access/brin/brin_bloom.c
index 2214fb4d0c..e83c2b82e1 100644
--- a/src/backend/access/brin/brin_bloom.c
+++ b/src/backend/access/brin/brin_bloom.c
@@ -409,7 +409,7 @@ typedef struct BloomOpaque
 {
 	/*
 	 * XXX At this point we only need a single proc (to compute the hash), but
-	 * let's keep the array just like inclusion and minman opclasses, for
+	 * let's keep the array just like inclusion and minmax opclasses, for
 	 * consistency. We may need additional procs in the future.
 	 */
 	FmgrInfo	extra_procinfos[BLOOM_MAX_PROCNUMS];
-- 
2.17.0

0017-reference-matching.patchtext/x-diff; charset=us-asciiDownload
From bfee5f3ae5422e5742bb04055c220ca8e3e48663 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 15 Apr 2021 23:28:37 -0500
Subject: [PATCH 17/27] reference / matching

a4d75c86bf15220df22de0a92c819ecef9db3849
---
 src/backend/statistics/dependencies.c | 2 +-
 src/backend/utils/adt/selfuncs.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/statistics/dependencies.c b/src/backend/statistics/dependencies.c
index cf8a6d5f68..cfe02b0cbe 100644
--- a/src/backend/statistics/dependencies.c
+++ b/src/backend/statistics/dependencies.c
@@ -1450,7 +1450,7 @@ dependencies_clauselist_selectivity(PlannerInfo *root,
 		if (!bms_is_member(listidx, *estimatedclauses))
 		{
 			/*
-			 * If it's a simple column refrence, just extract the attnum. If
+			 * If it's a simple column reference, just extract the attnum. If
 			 * it's an expression, assign a negative attnum as if it was a
 			 * system attribute.
 			 */
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 0963e2701c..3d4304cce7 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -4039,7 +4039,7 @@ estimate_multivariate_ndistinct(PlannerInfo *root, RelOptInfo *rel,
 
 			/*
 			 * Process a simple Var expression, by matching it to keys
-			 * directly. If there's a matchine expression, we'll try
+			 * directly. If there's a matching expression, we'll try
 			 * matching it later.
 			 */
 			if (IsA(varinfo->var, Var))
-- 
2.17.0

0018-involves.patchtext/x-diff; charset=us-asciiDownload
From d76ef5ff114f157c857f8e3256c0e0600fc9aad6 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 15 Apr 2021 23:44:39 -0500
Subject: [PATCH 18/27] involves

bfa2cee784125047771db2768fcf7f04d8bd6bb4
---
 src/port/bsearch_arg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/port/bsearch_arg.c b/src/port/bsearch_arg.c
index 0f1eaeba83..8849bdffd2 100644
--- a/src/port/bsearch_arg.c
+++ b/src/port/bsearch_arg.c
@@ -43,7 +43,7 @@
  * is odd, moving left simply involves halving lim: e.g., when lim
  * is 5 we look at item 2, so we change lim to 2 so that we will
  * look at items 0 & 1.  If lim is even, the same applies.  If lim
- * is odd, moving right again involes halving lim, this time moving
+ * is odd, moving right again involves halving lim, this time moving
  * the base up one item past p: e.g., when lim is 5 we change base
  * to item 3 and make lim 2 so that we will look at items 3 and 4.
  * If lim is even, however, we have to shrink it by one before
-- 
2.17.0

0019-determine.patchtext/x-diff; charset=us-asciiDownload
From 00e52b6c317cfed74b87c2289f3277d78ad8a5d6 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 15 Apr 2021 23:50:44 -0500
Subject: [PATCH 19/27] determine

72ccf55cb99c6450dfb77f2f8f4a28b5c049ef7a
---
 src/backend/access/brin/brin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c
index c320e21508..35e0ffcfa5 100644
--- a/src/backend/access/brin/brin.c
+++ b/src/backend/access/brin/brin.c
@@ -596,7 +596,7 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
 					 * and if we're violating them. In that case we can
 					 * terminate early, without invoking the support function.
 					 *
-					 * As there may be more keys, we can only detemine
+					 * As there may be more keys, we can only determine
 					 * mismatch within this loop.
 					 */
 					if (bdesc->bd_info[attno - 1]->oi_regular_nulls &&
-- 
2.17.0

0020-conservative.patchtext/x-diff; charset=us-asciiDownload
From 7f20482fc8381a0be0d5b4958b3b5e9bae7350b3 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 15 Apr 2021 23:53:40 -0500
Subject: [PATCH 20/27] conservative

3b6c1259f9ca8e21860aaf24ec6735a8e5598ea0
---
 contrib/amcheck/verify_heapam.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/amcheck/verify_heapam.c b/contrib/amcheck/verify_heapam.c
index 9366f45d74..9f159eb3db 100644
--- a/contrib/amcheck/verify_heapam.c
+++ b/contrib/amcheck/verify_heapam.c
@@ -930,7 +930,7 @@ check_tuple_visibility(HeapCheckContext *ctx)
 			 * If xmin_status happens to be XID_IS_CURRENT_XID, then in theory
 			 * any such DDL changes ought to be visible to us, so perhaps
 			 * we could check anyway in that case. But, for now, let's be
-			 * conservate and treat this like any other uncommitted insert.
+			 * conservative and treat this like any other uncommitted insert.
 			 */
 			return false;
 		}
-- 
2.17.0

0021-clause.patchtext/x-diff; charset=us-asciiDownload
From 85df2b17a1bf02ae73ac9f749ca4412a554f9dec Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 15 Apr 2021 23:55:57 -0500
Subject: [PATCH 21/27] clause

3696a600e2292d43c00949ddf0352e4ebb487e5b
---
 src/backend/rewrite/rewriteSearchCycle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/rewrite/rewriteSearchCycle.c b/src/backend/rewrite/rewriteSearchCycle.c
index 1a7d66fa6f..2d0ac378a8 100644
--- a/src/backend/rewrite/rewriteSearchCycle.c
+++ b/src/backend/rewrite/rewriteSearchCycle.c
@@ -59,7 +59,7 @@
  * SQL standard actually does it in that more complicated way), but the
  * internal representation allows us to construct it this way.)
  *
- * With a search caluse
+ * With a search clause
  *
  * SEARCH DEPTH FIRST BY col1, col2 SET sqc
  *
-- 
2.17.0

0022-attribute.patchtext/x-diff; charset=us-asciiDownload
From 68e8197df5e00b5619ec9884090d02eabec9f61d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 15 Apr 2021 23:57:13 -0500
Subject: [PATCH 22/27] attribute

a681e3c107aa97eb554f118935c4d2278892c3dd
---
 src/backend/access/brin/brin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c
index 35e0ffcfa5..c23ea44866 100644
--- a/src/backend/access/brin/brin.c
+++ b/src/backend/access/brin/brin.c
@@ -636,7 +636,7 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
 
 					/*
 					 * Collation from the first key (has to be the same for
-					 * all keys for the same attribue).
+					 * all keys for the same attribute).
 					 */
 					collation = keys[attno - 1][0]->sk_collation;
 
-- 
2.17.0

0023-thinest.patchtext/x-diff; charset=us-asciiDownload
From 0e5fcfd1a2a76eee61d380414e2039821ba00fce Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 16 Apr 2021 00:13:28 -0500
Subject: [PATCH 23/27] thinest

7854e07f25be3a3dfa9c94011a30767eca3c10ba and ec498cdcbb7e7b430acc7236ab19ef70f116441a
---
 src/backend/access/index/genam.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/access/index/genam.c b/src/backend/access/index/genam.c
index 1c3e937c61..0aa26b448b 100644
--- a/src/backend/access/index/genam.c
+++ b/src/backend/access/index/genam.c
@@ -633,7 +633,7 @@ systable_endscan(SysScanDesc sysscan)
  * Currently we do not support non-index-based scans here.  (In principle
  * we could do a heapscan and sort, but the uses are in places that
  * probably don't need to still work with corrupted catalog indexes.)
- * For the moment, therefore, these functions are merely the thinnest of
+ * For the moment, therefore, these functions are merely the thinest of
  * wrappers around index_beginscan/index_getnext_slot.  The main reason for
  * their existence is to centralize possible future support of lossy operators
  * in catalog scans.
-- 
2.17.0

0024-selectivity.patchtext/x-diff; charset=us-asciiDownload
From d5d45ba3094ca77e27c05dd65feb4bee20a5d932 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 16 Apr 2021 00:23:32 -0500
Subject: [PATCH 24/27] selectivity

87779aa47463d0fb3b4743a7d5c9534994bf7c98
---
 src/backend/statistics/dependencies.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/statistics/dependencies.c b/src/backend/statistics/dependencies.c
index cfe02b0cbe..ba7decb6a4 100644
--- a/src/backend/statistics/dependencies.c
+++ b/src/backend/statistics/dependencies.c
@@ -972,7 +972,7 @@ find_strongest_dependency(MVDependencies **dependencies, int ndependencies,
 /*
  * clauselist_apply_dependencies
  *		Apply the specified functional dependencies to a list of clauses and
- *		return the estimated selecvitity of the clauses that are compatible
+ *		return the estimated selectivity of the clauses that are compatible
  *		with any of the given dependencies.
  *
  * This will estimate all not-already-estimated clauses that are compatible
-- 
2.17.0

0025-then-remain-pivot.patchtext/x-diff; charset=us-asciiDownload
From 95fa0242906f39467d656ea1a02e4cd3ea50cead Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 16 Apr 2021 00:14:30 -0500
Subject: [PATCH 25/27] then / remain / pivot

d2d8a229bc58a2014dce1c7a4fcdb6c5ab9fb8da
---
 src/backend/executor/nodeIncrementalSort.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backend/executor/nodeIncrementalSort.c b/src/backend/executor/nodeIncrementalSort.c
index 459c879f0b..18f246a823 100644
--- a/src/backend/executor/nodeIncrementalSort.c
+++ b/src/backend/executor/nodeIncrementalSort.c
@@ -661,9 +661,9 @@ ExecIncrementalSort(PlanState *pstate)
 			/*
 			 * We're in full sort mode accumulating a minimum number of tuples
 			 * and not checking for prefix key equality yet, so we can't
-			 * assume the group pivot tuple will reamin the same -- unless
+			 * assume the group pivot tuple will remain the same -- unless
 			 * we're using a minimum group size of 1, in which case the pivot
-			 * is obviously still the pviot.
+			 * is obviously still the pivot.
 			 */
 			if (nTuples != minGroupSize)
 				ExecClearTuple(node->group_pivot);
@@ -1162,7 +1162,7 @@ ExecReScanIncrementalSort(IncrementalSortState *node)
 	}
 
 	/*
-	 * If chgParam of subnode is not null, theni the plan will be re-scanned
+	 * If chgParam of subnode is not null, then the plan will be re-scanned
 	 * by the first ExecProcNode.
 	 */
 	if (outerPlan->chgParam == NULL)
-- 
2.17.0

0026-maximum.patchtext/x-diff; charset=us-asciiDownload
From 8bba22bba90634f0d514f22755cdfde71195a65f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 16 Apr 2021 01:30:36 -0500
Subject: [PATCH 26/27] maximum

d06215d03b50c264a0f31e335b895ee1b6753e68
---
 src/backend/statistics/extended_stats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index e54e8aa8e0..7e11cb9d5f 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -358,7 +358,7 @@ statext_compute_stattarget(int stattarget, int nattrs, VacAttrStats **stats)
 	 */
 	for (i = 0; i < nattrs; i++)
 	{
-		/* keep the maximmum statistics target */
+		/* keep the maximum statistics target */
 		if (stats[i]->attr->attstattarget > stattarget)
 			stattarget = stats[i]->attr->attstattarget;
 	}
-- 
2.17.0

0027-further.patchtext/x-diff; charset=us-asciiDownload
From 4a9acadbeb44cb71fcf4986c576709e82a6c6c33 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 16 Apr 2021 01:36:34 -0500
Subject: [PATCH 27/27] further

b027ad9a7a95fb14b62b73b507d1a8c7d6f5e940
---
 src/common/pg_lzcompress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/pg_lzcompress.c b/src/common/pg_lzcompress.c
index fdd527f757..a30a2c2eb8 100644
--- a/src/common/pg_lzcompress.c
+++ b/src/common/pg_lzcompress.c
@@ -147,7 +147,7 @@
  *
  *			For each subsequent entry in the history list, the "good_match"
  *			is lowered by 10%. So the compressor will be more happy with
- *			short matches the farer it has to go back in the history.
+ *			short matches the further it has to go back in the history.
  *			Another "speed against ratio" preference characteristic of
  *			the algorithm.
  *
-- 
2.17.0

#34Michael Paquier
michael@paquier.xyz
In reply to: Justin Pryzby (#33)
Re: doc review for v14

On Fri, Apr 16, 2021 at 02:03:10AM -0500, Justin Pryzby wrote:

A bunch more found with things like this.

Thanks, applied most of it!
--
Michael