doc review for v13

Started by Justin Pryzbyalmost 6 years ago23 messages
#1Justin Pryzby
pryzby@telsasoft.com
19 attachment(s)

I reviewed docs for v13, like:
git log --cherry-pick origin/master...origin/REL_12_STABLE -p doc

I did something similar for v12 [0]/messages/by-id/20190709161256.GH22387@telsasoft.com. I've included portions of that here which
still seem lacking 12 months later (but I'm not intending to continue defending
each individual patch hunk).

I previously mailed separately about a few individual patches, some of which
have separate, ongoing discussion and aren't included here (incr sort, parallel
vacuum).

Justin

[0]: /messages/by-id/20190709161256.GH22387@telsasoft.com

Attachments:

v1-0001-docs-pg_statistic_ext.stxstattarget.patchtext/x-diff; charset=us-asciiDownload
From 482b590355cd7df327602dd36e91721b827f9c37 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 19:31:04 -0500
Subject: [PATCH v1 01/19] docs: pg_statistic_ext.stxstattarget

commit c31132d87c6315bbbe4b4aa383705aaae2348c0e
Author: Tomas Vondra <tomas.vondra@postgresql.org>
Date:   Wed Mar 18 16:48:12 2020 +0100
---
 doc/src/sgml/catalogs.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 386c6d7bd1..ce33df9e58 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -6472,7 +6472,7 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
        <xref linkend="sql-analyze"/>.
        A zero value indicates that no statistics should be collected.
        A negative value says to use the system default statistics target.
-       Positive values <structfield>stxstattarget</structfield>
+       Positive values of <structfield>stxstattarget</structfield>
        determine the target number of <quote>most common values</quote>
        to collect.
       </entry>
-- 
2.17.0

v1-0002-docs-reg-functions.patchtext/x-diff; charset=us-asciiDownload
From 2a3a4d7028b02070447fafd37e66e72da59966bf Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 19:33:44 -0500
Subject: [PATCH v1 02/19] docs: reg* functions

commit 8408e3a557ad26a7e88f867a425b2b9a86c4fa04
Author: Peter Eisentraut <peter@eisentraut.org>
Date:   Wed Mar 18 14:51:37 2020 +0100
---
 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 a38387b8c6..fd0f5d64b3 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -18796,7 +18796,7 @@ SELECT collation for ('foo' COLLATE "de_DE");
    <function>to_regnamespace</function>, <function>to_regoper</function>,
    <function>to_regoperator</function>, <function>to_regrole</function>,
    <function>to_regproc</function>, <function>to_regprocedure</function>, and
-   <function>to_regtype</function>, functions translate relation, collation, schema,
+   <function>to_regtype</function> translate relation, collation, schema,
    operator, role, function, and type names (given as <type>text</type>) to
    objects of the corresponding <type>reg*</type> type (see <xref
    linkend="datatype-oid"/> about the types).  These functions differ from a
-- 
2.17.0

v1-0003-Minus-one.patchtext/x-diff; charset=us-asciiDownload
From 6864ced0a9eaeab4c010d1f090b26b337f125742 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 19:43:42 -0500
Subject: [PATCH v1 03/19] Minus one

See also
ac862376037727e744f25030bd8b6090c707247b
---
 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 a0da4aabac..ea2749535d 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -6110,7 +6110,7 @@ local0.*    /var/log/postgresql
          unoptimized queries in your applications.
          If this value is specified without units, it is taken as milliseconds.
          Setting this to zero prints all statement durations.
-         Minus-one (the default) disables logging statement durations.
+         <literal>-1</literal> (the default) disables logging statement durations.
          Only superusers can change this setting.
         </para>
 
@@ -6162,7 +6162,7 @@ local0.*    /var/log/postgresql
          traffic is too high to log all queries.
          If this value is specified without units, it is taken as milliseconds.
          Setting this to zero samples all statement durations.
-         Minus-one (the default) disables sampling statement durations.
+         <literal>-1</literal> (the default) disables sampling statement durations.
          Only superusers can change this setting.
         </para>
 
-- 
2.17.0

v1-0004-doc-psql-opclass-opfamily.patchtext/x-diff; charset=us-asciiDownload
From bfb8439eb5618db3a36ca2794dbcc35489d98c27 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 19:51:32 -0500
Subject: [PATCH v1 04/19] doc: psql opclass/opfamily

commit b0b5e20cd8d1a58a8782d5dc806a5232db116e2f
Author: Alexander Korotkov <akorotkov@postgresql.org>

ALSO, should we rename the "Purpose" column?  I see we have pg_amop.amoppurpose
so maybe it's fine ?
---
 doc/src/sgml/ref/psql-ref.sgml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 0595d1c04b..cdd24fad98 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1244,7 +1244,7 @@ testdb=&gt;
         (see <xref linkend="catalog-pg-opclass"/>).
         If <replaceable class="parameter">access-method-patttern</replaceable>
         is specified, only operator classes associated with access methods whose
-        names match pattern are listed.
+        names match the pattern are listed.
         If <replaceable class="parameter">input-type-pattern</replaceable>
         is specified, only operator classes associated with input types whose
         names match the pattern are listed.
@@ -1267,7 +1267,7 @@ testdb=&gt;
         (see <xref linkend="catalog-pg-opfamily"/>).
         If <replaceable class="parameter">access-method-patttern</replaceable>
         is specified, only operator families associated with access methods whose
-        names match pattern are listed.
+        names match the pattern are listed.
         If <replaceable class="parameter">input-type-pattern</replaceable>
         is specified, only operator families associated with input types whose
         names match the pattern are listed.
@@ -1291,7 +1291,7 @@ testdb=&gt;
         (<xref linkend="catalog-pg-amop"/>).
         If <replaceable class="parameter">access-method-patttern</replaceable>
         is specified, only members of operator families associated with access
-        methods whose names match pattern are listed.
+        methods whose names match the pattern are listed.
         If <replaceable class="parameter">input-type-pattern</replaceable>
         is specified, only members of operator families whose names match the
         pattern are listed.
@@ -1314,7 +1314,7 @@ testdb=&gt;
         (<xref linkend="catalog-pg-amproc"/>).
         If <replaceable class="parameter">access-method-patttern</replaceable>
         is specified, only members of operator families associated with access
-        methods whose names match pattern are listed.
+        methods whose names match the pattern are listed.
         If <replaceable class="parameter">input-type-pattern</replaceable>
         is specified, only members of operator families whose names match the
         pattern are listed.
-- 
2.17.0

v1-0005-doc-percent-encoding.patchtext/x-diff; charset=us-asciiDownload
From 7a8c29ee91a89eb67d56e4583a60261c66c86104 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 21:31:08 -0500
Subject: [PATCH v1 05/19] doc: percent encoding

commit e0ed6817c0ee218a3681920807404603e042ff04
Author: Michael Paquier <michael@paquier.xyz>
---
 doc/src/sgml/libpq.sgml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index c2b3cdabad..593323ec1b 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -925,11 +925,11 @@ postgresql:///mydb?host=localhost&amp;port=5433
    </para>
 
    <para>
-    Connection <acronym>URI</acronym> needs to be encoded with 
+    A connection <acronym>URI</acronym> needs to be encoded with 
     <ulink url="https://tools.ietf.org/html/rfc3986#section-2.1">Percent-encoding</ulink> 
-    if it includes symbols with special meaning in any of its parts. 
-    Here is an example where equal sign (<literal>=</literal>) is replaced
-    with <literal>%3D</literal> and whitespace character with
+    if it includes symbols with special meanings in any of its parts. 
+    Here is an example with an equal sign (<literal>=</literal>) replaced
+    by <literal>%3D</literal> and whitespace character with
     <literal>%20</literal>:
 <programlisting>
 postgresql://user@localhost:5433/mydb?options=-c%20synchronous_commit%3Doff
-- 
2.17.0

v1-0006-docs-btree-deduplication.patchtext/x-diff; charset=us-asciiDownload
From e5afdb48b56da5919e1397007d06114d24c83efb Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 30 Mar 2020 19:43:22 -0500
Subject: [PATCH v1 06/19] docs: btree deduplication

commit 0d861bbb702f8aa05c2a4e3f1650e7e8df8c8c27
Author: Peter Geoghegan <pg@bowt.ie>
---
 doc/src/sgml/btree.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/btree.sgml b/doc/src/sgml/btree.sgml
index f02e02b0ac..ff1e49e509 100644
--- a/doc/src/sgml/btree.sgml
+++ b/doc/src/sgml/btree.sgml
@@ -609,7 +609,7 @@ equalimage(<replaceable>opcintype</replaceable> <type>oid</type>) returns bool
   </para>
   <para>
    Deduplication works by periodically merging groups of duplicate
-   tuples together, forming a single posting list tuple for each
+   tuples together, forming a single <firstterm>posting list</firstterm> tuple for each
    group.  The column key value(s) only appear once in this
    representation.  This is followed by a sorted array of
    <acronym>TID</acronym>s that point to rows in the table.  This
@@ -685,7 +685,7 @@ equalimage(<replaceable>opcintype</replaceable> <type>oid</type>) returns bool
    Deduplication cannot be used in all cases due to
    implementation-level restrictions.  Deduplication safety is
    determined when <command>CREATE INDEX</command> or
-   <command>REINDEX</command> run.
+   <command>REINDEX</command> is run.
   </para>
   <para>
    Note that deduplication is deemed unsafe and cannot be used in the
-- 
2.17.0

v1-0007-comment-typos.patchtext/x-diff; charset=us-asciiDownload
From 2e0bfbf16e7aad18e3c679a65749bd824bfb3a6d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 17 Feb 2020 12:33:42 -0600
Subject: [PATCH v1 07/19] comment typos

---
 contrib/pgcrypto/imath.c               | 4 ++--
 src/backend/access/transam/multixact.c | 2 +-
 src/backend/commands/tablecmds.c       | 2 +-
 src/backend/executor/execExpr.c        | 2 +-
 src/backend/postmaster/bgworker.c      | 2 +-
 src/include/lib/simplehash.h           | 4 ++--
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/contrib/pgcrypto/imath.c b/contrib/pgcrypto/imath.c
index da4cdede76..a05a4bf5fd 100644
--- a/contrib/pgcrypto/imath.c
+++ b/contrib/pgcrypto/imath.c
@@ -3232,7 +3232,7 @@ s_embar(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c)
 
    We diverge from Knuth's algorithm in that we do not perform the subtraction
    from the remainder until we have determined that we have the correct
-   quotient digit. This makes our algorithm less efficient that Knuth because
+   quotient digit. This makes our algorithm less efficient than Knuth because
    we might have to perform multiple multiplication and comparison steps before
    the subtraction. The advantage is that it is easy to implement and ensure
    correctness without worrying about underflow from the subtraction.
@@ -3355,7 +3355,7 @@ s_udiv_knuth(mp_int u, mp_int v)
 
 		/*
 		 * Check to see if qhat > b, and decrease qhat if so. Theorem B
-		 * guarantess that qhat is at most 2 larger than the actual value, so
+		 * guarantees that qhat is at most 2 larger than the actual value, so
 		 * it is possible that qhat is greater than the maximum value that
 		 * will fit in a digit
 		 */
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index 70d0e1c215..e2aa5c9ce4 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -2666,7 +2666,7 @@ SetOffsetVacuumLimit(bool is_startup)
  * We use this to determine whether the addition is "wrapping around" the
  * boundary point, hence the name.  The reason we don't want to use the regular
  * 2^31-modulo arithmetic here is that we want to be able to use the whole of
- * the 2^32-1 space here, allowing for more multixacts that would fit
+ * the 2^32-1 space here, allowing for more multixacts than would fit
  * otherwise.
  */
 static bool
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 6162fb018c..037d457c3d 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -16846,7 +16846,7 @@ ATExecDetachPartition(Relation rel, RangeVar *name)
 	list_free_deep(fks);
 
 	/*
-	 * Any sub-constrains that are in the referenced-side of a larger
+	 * Any sub-constraints that are in the referenced-side of a larger
 	 * constraint have to be removed.  This partition is no longer part of the
 	 * key space of the constraint.
 	 */
diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c
index 1370ffec50..c6a77bd66f 100644
--- a/src/backend/executor/execExpr.c
+++ b/src/backend/executor/execExpr.c
@@ -2366,7 +2366,7 @@ get_last_attnums_walker(Node *node, LastAttnumInfo *info)
  * evaluation of the expression will have the same type of slot, with an
  * equivalent descriptor.
  *
- * Returns true if the the deforming step is required, false otherwise.
+ * Returns true if the deforming step is required, false otherwise.
  */
 static bool
 ExecComputeSlotInfo(ExprState *state, ExprEvalStep *op)
diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c
index 6c684b5e12..beb5e85434 100644
--- a/src/backend/postmaster/bgworker.c
+++ b/src/backend/postmaster/bgworker.c
@@ -1149,7 +1149,7 @@ WaitForBackgroundWorkerShutdown(BackgroundWorkerHandle *handle)
  * Instruct the postmaster to terminate a background worker.
  *
  * Note that it's safe to do this without regard to whether the worker is
- * still running, or even if the worker may already have existed and been
+ * still running, or even if the worker may already have exited and been
  * unregistered.
  */
 void
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 8cb03cda6c..88f4c9a53f 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -560,7 +560,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++;
@@ -633,7 +633,7 @@ restart:
 			/* shift forward, starting at last occupied element */
 
 			/*
-			 * TODO: This could be optimized to be one memcpy in may cases,
+			 * TODO: This could be optimized to be one memcpy in many cases,
 			 * excepting wrapping around at the end of ->data. Hasn't shown up
 			 * in profiles so far though.
 			 */
-- 
2.17.0

v1-0008-doc-pg_stat_progress_basebackup.patchtext/x-diff; charset=us-asciiDownload
From 86b3afbcc8b3b011dfc9365b968d583c7bbfc05d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 21:22:43 -0500
Subject: [PATCH v1 08/19] doc: pg_stat_progress_basebackup

commit e65497df8f85ab9b9084c928ff69f384ea729b24
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index c50b72137f..3ad1fd7005 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -4483,7 +4483,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
    is taking a base backup, the
    <structname>pg_stat_progress_basebackup</structname>
    view will contain a row for each WAL sender process that is currently
-   running <command>BASE_BACKUP</command> replication command
+   running the <command>BASE_BACKUP</command> replication command
    and streaming the backup. The tables below describe the information
    that will be reported and provide information about how to interpret it.
   </para>
@@ -4577,8 +4577,8 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
       <entry><literal>waiting for checkpoint to finish</literal></entry>
       <entry>
        The WAL sender process is currently performing
-       <function>pg_start_backup</function> to set up for
-       taking a base backup, and waiting for backup start
+       <function>pg_start_backup</function> to prepare to
+       take a base backup, and waiting for the start-of-backup
        checkpoint to finish.
       </entry>
      </row>
-- 
2.17.0

v1-0009-docs-backup-manifests.patchtext/x-diff; charset=us-asciiDownload
From 1343f9fb970f06d7afb6ffd5f9fe4b9264449446 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 3 Apr 2020 16:17:28 -0500
Subject: [PATCH v1 09/19] docs: backup manifests

commit 0d8c9c1210c44b36ec2efcb223a1dfbe897a3661
Author: Robert Haas <rhaas@postgresql.org>
---
 doc/src/sgml/protocol.sgml              |  4 ++--
 doc/src/sgml/ref/pg_basebackup.sgml     |  4 ++--
 doc/src/sgml/ref/pg_validatebackup.sgml | 12 ++++++------
 src/backend/replication/basebackup.c    |  2 +-
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 536de9a698..d84afb7b18 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2586,7 +2586,7 @@ The commands accepted in replication mode are:
           and sent along with the backup.  The manifest is a list of every
           file present in the backup with the exception of any WAL files that
           may be included. It also stores the size, last modification time, and
-          an optional checksum for each file.
+          optionally a checksum for each file.
           A value of <literal>force-escape</literal> forces all filenames
           to be hex-encoded; otherwise, this type of encoding is performed only
           for files whose names are non-UTF8 octet sequences.
@@ -2602,7 +2602,7 @@ The commands accepted in replication mode are:
         <term><literal>MANIFEST_CHECKSUMS</literal></term>
         <listitem>
          <para>
-          Specifies the algorithm that should be applied to each file included
+          Specifies the checksum algorithm that should be applied to each file included
           in the backup manifest. Currently, the available
           algorithms are <literal>NONE</literal>, <literal>CRC32C</literal>,
           <literal>SHA224</literal>, <literal>SHA256</literal>,
diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index d9c981cebb..16fa29f293 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -604,7 +604,7 @@ PostgreSQL documentation
         not contain any checksums. Otherwise, it will contain a checksum
         of each file in the backup using the specified algorithm. In addition,
         the manifest will always contain a <literal>SHA256</literal>
-        checksum of its own contents. The <literal>SHA</literal> algorithms
+        checksum of its own content. The <literal>SHA</literal> algorithms
         are significantly more CPU-intensive than <literal>CRC32C</literal>,
         so selecting one of them may increase the time required to complete
         the backup.
@@ -614,7 +614,7 @@ PostgreSQL documentation
         of each file for users who wish to verify that the backup has not been
         tampered with, while the CRC32C algorithm provides a checksum which is
         much faster to calculate and good at catching errors due to accidental
-        changes but is not resistant to targeted modifications.  Note that, to
+        changes but is not resistant to malicious modifications.  Note that, to
         be useful against an adversary who has access to the backup, the backup
         manifest would need to be stored securely elsewhere or otherwise
         verified not to have been modified since the backup was taken.
diff --git a/doc/src/sgml/ref/pg_validatebackup.sgml b/doc/src/sgml/ref/pg_validatebackup.sgml
index 19888dc196..748ac439a6 100644
--- a/doc/src/sgml/ref/pg_validatebackup.sgml
+++ b/doc/src/sgml/ref/pg_validatebackup.sgml
@@ -41,12 +41,12 @@ PostgreSQL documentation
   </para>
 
   <para>
-   It is important to note that that the validation which is performed by
-   <application>pg_validatebackup</application> does not and can not include
+   It is important to note that the validation which is performed by
+   <application>pg_validatebackup</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
-   expected and that they appear to contain the correct data. However,
+   expected and that they contain the correct data. However,
    <application>pg_validatebackup</application> can detect many problems
    that commonly occur due to storage problems or user error.
   </para>
@@ -73,7 +73,7 @@ PostgreSQL documentation
    a <literal>backup_manifest</literal> file in the target directory or
    about anything inside <literal>pg_wal</literal>, even though these
    files won't be listed in the backup manifest. Only files are checked;
-   the presence or absence or directories is not verified, except
+   the presence or absence of directories is not verified, except
    indirectly: if a directory is missing, any files it should have contained
    will necessarily also be missing. 
   </para>
@@ -84,7 +84,7 @@ PostgreSQL documentation
    for any files for which the computed checksum does not match the
    checksum stored in the manifest. This step is not performed for any files
    which produced errors in the previous step, since they are already known
-   to have problems. Also, files which were ignored in the previous step are
+   to have problems. Files which were ignored in the previous step are
    also ignored in this step.
   </para>
 
@@ -123,7 +123,7 @@ PostgreSQL documentation
   <title>Options</title>
 
    <para>
-    The following command-line options control the behavior.
+    The following command-line options control the behavior of this program.
 
     <variablelist>
      <varlistentry>
diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c
index 5d94b9c229..619ab00bd3 100644
--- a/src/backend/replication/basebackup.c
+++ b/src/backend/replication/basebackup.c
@@ -1149,7 +1149,7 @@ AddFileToManifest(manifest_info *manifest, const char *spcoid,
 	}
 
 	/*
-	 * Each file's entry need to be separated from any entry that follows by a
+	 * Each file's entry needs to be separated from any entry that follows by a
 	 * comma, but there's no comma before the first one or after the last one.
 	 * To make that work, adding a file to the manifest starts by terminating
 	 * the most recently added line, with a comma if appropriate, but does not
-- 
2.17.0

v1-0010-doc-libq-support-for-sslpassword-connection-param.patchtext/x-diff; charset=us-asciiDownload
From cbbefc2b0f93f881b29632bee1973ac55215a1e9 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 5 Apr 2020 21:11:48 -0500
Subject: [PATCH v1 10/19] doc: libq support for sslpassword connection param, 
 DER format keys

commit 4dc63552109f65cebbe168203bd62c5e4c753162
Author: Andrew Dunstan <andrew@dunslane.net>
---
 doc/src/sgml/libpq.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 593323ec1b..2d00d3b1e6 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -797,7 +797,7 @@ void PQsetSSLKeyPassHook(PQsslKeyPassHook_type hook);
        its default <function>PQdefaultSSLKeyPassHook</function> handler. The callback
        should determine the password for the key and copy it to result-buffer
        <literal>buf</literal> of size <literal>size</literal>. The string in <literal>
-       buf</literal> must be null-terminated. The calback must return the length of
+       buf</literal> must be null-terminated. The callback must return the length of
        the password stored in <literal>buf</literal> excluding the null terminator.
        On failure, the callback should set <literal>buf[0] = '\0'</literal> and return 0.
        See <function>PQdefaultSSLKeyPassHook</function> in <literal>libpq</literal>'s
-- 
2.17.0

v1-0011-doc-Implement-jsonpath-.datetime-method.patchtext/x-diff; charset=us-asciiDownload
From b3ef09a77684a53f5f09c6059a316c54dfa56548 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 5 Apr 2020 22:15:23 -0500
Subject: [PATCH v1 11/19] doc: Implement jsonpath .datetime() method

commit bffe1bd68457e43925c362d8728ce3b25bdf1c94
Author: Alexander Korotkov <akorotkov@postgresql.org>
---
 doc/src/sgml/func.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index fd0f5d64b3..b708b79229 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -12360,9 +12360,9 @@ table2-mapping
 
   <note>
    <para>
-    Some of the <literal>jsonb_path_*</literal> functions have the
+    Some of the <literal>jsonb_path_*</literal> functions have a
     <literal>_tz</literal> suffix. These functions have been implemented to
-    support comparison of date/time values that involves implicit
+    support comparison of date/time values that involve implicit
     timezone-aware casts. Since operations with time zones are not immutable,
     these functions are qualified as stable. Their counterparts without the
     suffix do not support such casts, so they are immutable and can be used for
-- 
2.17.0

v1-0012-Fix-docs-time-of-the.patchtext/x-diff; charset=us-asciiDownload
From 97093e4f5335527b8c0ed32bbce937c6b9ce3cb0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 5 Apr 2020 22:35:09 -0500
Subject: [PATCH v1 12/19] Fix docs: "time of the"

commit 9e257a181cc1dc5e19eb5d770ce09cc98f470f5f
Author: Andrew Dunstan <andrew@dunslane.net>
Date:   Sun Mar 24 11:27:20 2013 -0400

    Add parallel pg_dump option.

commit 5ab892c391c6bc54a00e7a8de5cab077cabace6a
Author: Michael Paquier <michael@paquier.xyz>
Date:   Sat Jul 27 22:21:18 2019 +0900

    Add support for --jobs in reindexdb

commit a17923204736d8842eade3517d6a8ee81290fca4
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:   Fri Jan 23 15:02:45 2015 -0300

    vacuumdb: enable parallel mode
---
 doc/src/sgml/ref/pg_dump.sgml   | 2 +-
 doc/src/sgml/ref/reindexdb.sgml | 4 ++--
 doc/src/sgml/ref/vacuumdb.sgml  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index a9bc397165..d58cd05f46 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -323,7 +323,7 @@ PostgreSQL documentation
       <listitem>
        <para>
         Run the dump in parallel by dumping <replaceable class="parameter">njobs</replaceable>
-        tables simultaneously. This option reduces the time of the dump but it also
+        tables simultaneously. This option reduces the duration of the dump but it also
         increases the load on the database server. You can only use this option with the
         directory output format because this is the only output format where multiple processes
         can write their data at the same time.
diff --git a/doc/src/sgml/ref/reindexdb.sgml b/doc/src/sgml/ref/reindexdb.sgml
index f6c3d9538b..4388d1329c 100644
--- a/doc/src/sgml/ref/reindexdb.sgml
+++ b/doc/src/sgml/ref/reindexdb.sgml
@@ -173,8 +173,8 @@ PostgreSQL documentation
        <para>
         Execute the reindex commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option reduces the processing time
+        but it also increases the load on the database server.
        </para>
        <para>
         <application>reindexdb</application> will open
diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml
index fd1dc140ab..93a3eed813 100644
--- a/doc/src/sgml/ref/vacuumdb.sgml
+++ b/doc/src/sgml/ref/vacuumdb.sgml
@@ -155,8 +155,8 @@ PostgreSQL documentation
        <para>
         Execute the vacuum or analyze commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option reduces the processing
+        duration but it also increases the load on the database server.
        </para>
        <para>
         <application>vacuumdb</application> will open
-- 
2.17.0

v1-0013-docs-Add-wait-events-for-recovery-conflicts.patchtext/x-diff; charset=us-asciiDownload
From b86106d56d0f8cbc8aa651a5409d89a04c91dff5 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 5 Apr 2020 22:55:46 -0500
Subject: [PATCH v1 13/19] docs: Add wait events for recovery conflicts.

commit 18808f8c893d4f425f2d21b2a1ffc8e51f1bd0ba
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 3ad1fd7005..1a7b56b120 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1484,11 +1484,11 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
         </row>
         <row>
          <entry><literal>RecoveryConflictSnapshot</literal></entry>
-         <entry>Waiting for recovery conflict resolution on a vacuum cleanup.</entry>
+         <entry>Waiting for recovery conflict resolution during vacuum cleanup.</entry>
         </row>
         <row>
          <entry><literal>RecoveryConflictTablespace</literal></entry>
-         <entry>Waiting for recovery conflict resolution on dropping tablespace.</entry>
+         <entry>Waiting for recovery conflict resolution while dropping tablespace.</entry>
         </row>
         <row>
          <entry><literal>RecoveryPause</literal></entry>
-- 
2.17.0

v1-0014-doc-WAL-usage.patchtext/x-diff; charset=us-asciiDownload
From 03869a92f829f045f1d9a3545597152a55b192e4 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 6 Apr 2020 11:28:08 -0500
Subject: [PATCH v1 14/19] doc: WAL usage

See also:
6b466bf5f2bea0c89fab54eef696bcfc7ecdafd7
33e05f89c53e5a1533d624046bb6fb0da7bb7141
---
 contrib/pg_stat_statements/pg_stat_statements.c | 2 +-
 doc/src/sgml/pgstatstatements.sgml              | 6 +++---
 doc/src/sgml/ref/explain.sgml                   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c
index 04abdab904..3bcf34c669 100644
--- a/contrib/pg_stat_statements/pg_stat_statements.c
+++ b/contrib/pg_stat_statements/pg_stat_statements.c
@@ -189,7 +189,7 @@ typedef struct Counters
 	double		blk_write_time; /* time spent writing, in msec */
 	double		usage;			/* usage factor */
 	int64		wal_records;	/* # of WAL records generated */
-	int64		wal_num_fpw;	/* # of WAL full page image records generated */
+	int64		wal_num_fpw;	/* # of WAL full page images generated */
 	uint64		wal_bytes;		/* total amount of WAL bytes generated */
 } Counters;
 
diff --git a/doc/src/sgml/pgstatstatements.sgml b/doc/src/sgml/pgstatstatements.sgml
index 3d26108649..de28016a02 100644
--- a/doc/src/sgml/pgstatstatements.sgml
+++ b/doc/src/sgml/pgstatstatements.sgml
@@ -269,7 +269,7 @@
       <entry><type>numeric</type></entry>
       <entry></entry>
       <entry>
-        Total amount of WAL bytes generated by the statement
+        Total number of WAL bytes generated by the statement
       </entry>
      </row>
 
@@ -278,7 +278,7 @@
       <entry><type>bigint</type></entry>
       <entry></entry>
       <entry>
-        Total count of WAL records generated by the statement
+        Total number of WAL records generated by the statement
       </entry>
      </row>
 
@@ -287,7 +287,7 @@
       <entry><type>bigint</type></entry>
       <entry></entry>
       <entry>
-        Total count of WAL full page writes generated by the statement
+        Total number of WAL full page writes generated by the statement
       </entry>
      </row>
 
diff --git a/doc/src/sgml/ref/explain.sgml b/doc/src/sgml/ref/explain.sgml
index 024ede4a8d..4a9f94d7f8 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 image records and amount of WAL
+      number of records, number of full page images 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

v1-0015-doc-Allow-users-to-limit-storage-reserved-by-repl.patchtext/x-diff; charset=us-asciiDownload
From e8e0fc43fe78866cf3bc54509d2467e82f53662f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 7 Apr 2020 19:56:56 -0500
Subject: [PATCH v1 15/19] doc: Allow users to limit storage reserved by
 replication slots

commit c6550776394e25c1620bc8258427c8f1d448080d
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
---
 doc/src/sgml/config.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index ea2749535d..5d196aa454 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3790,9 +3790,9 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         slots</link> are allowed to retain in the <filename>pg_wal</filename>
         directory at checkpoint time.
         If <varname>max_slot_wal_keep_size</varname> is -1 (the default),
-        replication slots retain unlimited amount of WAL files.  If
-        restart_lsn of a replication slot gets behind more than that megabytes
-        from the current LSN, the standby using the slot may no longer be able
+        replication slots retain unlimited amount of WAL files.  Otherwise, if
+        restart_lsn of a replication slot falls behind the current LSN by more
+        than the specified size, the standby using the slot may no longer be able
         to continue replication due to removal of required WAL files. You
         can see the WAL availability of replication slots
         in <link linkend="view-pg-replication-slots">pg_replication_slots</link>.
-- 
2.17.0

v1-0016-docs-s-evade-avoid.patchtext/x-diff; charset=us-asciiDownload
From a59f53535110abe1a56912be809c42ae8384ea42 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 6 Apr 2020 17:16:07 -0500
Subject: [PATCH v1 16/19] docs: s/evade/avoid/

---
 src/backend/access/gin/README         | 2 +-
 src/backend/utils/adt/jsonpath_exec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/access/gin/README b/src/backend/access/gin/README
index 125a82219b..128a62cf42 100644
--- a/src/backend/access/gin/README
+++ b/src/backend/access/gin/README
@@ -413,7 +413,7 @@ leftmost leaf of the tree.
 Deletion algorithm keeps exclusive locks on left siblings of pages comprising
 currently investigated path.  Thus, if current page is to be removed, all
 required pages to remove both downlink and rightlink are already locked.  That
-evades potential right to left page locking order, which could deadlock with
+avoid potential right to left page locking order, which could deadlock with
 concurrent stepping right.
 
 A search concurrent to page deletion might already have read a pointer to the
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index bc063061cf..0faa66551f 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -35,7 +35,7 @@
  * executeItemOptUnwrapTarget() function have 'unwrap' argument, which indicates
  * whether unwrapping of array is needed.  When unwrap == true, each of array
  * members is passed to executeItemOptUnwrapTarget() again but with unwrap == false
- * in order to evade subsequent array unwrapping.
+ * in order to avoid subsequent array unwrapping.
  *
  * All boolean expressions (predicates) are evaluated by executeBoolItem()
  * function, which returns tri-state JsonPathBool.  When error is occurred
-- 
2.17.0

v1-0017-doc-2014-pg_basebackup-Add-support-for-relocating.patchtext/x-diff; charset=us-asciiDownload
From 496f0d8562095ba346caede74e3db4a3e22d21a0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 26 Feb 2020 12:33:32 -0600
Subject: [PATCH v1 17/19] doc(2014): pg_basebackup: Add support for relocating
 tablespaces

commit fb05f3ce83d225dd0f39f8860ce04082753e9e98
Author: Peter Eisentraut <peter_e@gmx.net>
---
 doc/src/sgml/ref/pg_basebackup.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index 16fa29f293..922688e227 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -808,7 +808,7 @@ PostgreSQL documentation
   </para>
 
   <para>
-   Tablespaces will in plain format by default be backed up to the same path
+   In plain format, tablespaces will by default be backed up to the same path
    they have on the server, unless the
    option <literal>--tablespace-mapping</literal> is used.  Without
    this option, running a plain format base backup on the same host as the
-- 
2.17.0

v1-0018-Say-it-more-naturally.patchtext/x-diff; charset=us-asciiDownload
From 3bb7ff0a44b773a18ca510cfa95dc883b880fbb7 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 9 Jul 2019 10:42:26 -0500
Subject: [PATCH v1 18/19] Say it more naturally

Originally submitted here and never integrated.
https://www.postgresql.org/message-id/flat/20190427025647.GD3925%40telsasoft.com#e1731c33455145eadc1158042cc411f9

Should backpatch to v12
---
 doc/src/sgml/config.sgml          | 4 ++--
 doc/src/sgml/ddl.sgml             | 2 +-
 doc/src/sgml/libpq.sgml           | 2 +-
 doc/src/sgml/monitoring.sgml      | 6 +++---
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 doc/src/sgml/ref/pg_rewind.sgml   | 4 ++--
 doc/src/sgml/ref/reindex.sgml     | 2 +-
 doc/src/sgml/runtime.sgml         | 2 +-
 doc/src/sgml/sources.sgml         | 4 ++--
 9 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 5d196aa454..2ee1afce66 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -112,7 +112,7 @@
        For example, <literal>30.1 GB</literal> will be converted
        to <literal>30822 MB</literal> not <literal>32319628902 B</literal>.
        If the parameter is of integer type, a final rounding to integer
-       occurs after any units conversion.
+       occurs after any unit conversion.
       </para>
      </listitem>
 
@@ -3667,7 +3667,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         servers or streaming base backup clients (i.e., the maximum number of
         simultaneously running WAL sender processes). The default is
         <literal>10</literal>.  The value <literal>0</literal> means
-        replication is disabled.  Abrupt streaming client disconnection might
+        replication is disabled.  Abrupt disconnection of a streaming client might
         leave an orphaned connection slot behind until a timeout is reached,
         so this parameter should be set slightly higher than the maximum
         number of expected clients so disconnected clients can immediately
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index ab27645319..f61d366d1d 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3959,7 +3959,7 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02
      Before running the <command>ATTACH PARTITION</command> command, it is
      recommended to create a <literal>CHECK</literal> constraint on the table to
      be attached matching the desired partition constraint. That way,
-     the system will be able to skip the scan to validate the implicit
+     the system will be able to skip the scan which is otherwise needed to validate the implicit
      partition constraint. Without the <literal>CHECK</literal> constraint,
      the table will be scanned to validate the partition constraint while
      holding an <literal>ACCESS EXCLUSIVE</literal> lock on that partition
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 2d00d3b1e6..c283b223f0 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -1223,7 +1223,7 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
       <term><literal>connect_timeout</literal></term>
       <listitem>
       <para>
-       Maximum wait for connection, in seconds (write as a decimal integer,
+       Maximum time to wait while connecting, in seconds (write as a decimal integer,
        e.g. <literal>10</literal>).  Zero, negative, or not specified means
        wait indefinitely.  The minimum allowed timeout is 2 seconds, therefore
        a value of <literal>1</literal> is interpreted as <literal>2</literal>.
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 1a7b56b120..52264853eb 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -2596,14 +2596,14 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <row>
      <entry><structfield>datname</structfield></entry>
      <entry><type>name</type></entry>
-     <entry>Name of this database, or <literal>NULL</literal> for the shared
+     <entry>Name of this database, or <literal>NULL</literal> for shared
      objects.</entry>
     </row>
     <row>
      <entry><structfield>numbackends</structfield></entry>
      <entry><type>integer</type></entry>
      <entry>Number of backends currently connected to this database, or
-     <literal>NULL</literal> for the shared objects.  This is the only column
+     <literal>NULL</literal> for shared objects.  This is the only column
      in this view that returns a value reflecting current state; all other
      columns return the accumulated values since the last reset.</entry>
     </row>
@@ -2725,7 +2725,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
 
   <para>
    The <structname>pg_stat_database</structname> view will contain one row
-   for each database in the cluster, plus one for the shared objects, showing
+   for each database in the cluster, plus one for shared objects, showing
    database-wide statistics.
   </para>
 
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index e486196477..fe0f077d1f 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -666,7 +666,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       When applied to a partitioned table, nothing is moved, but any
       partitions created afterwards with
       <command>CREATE TABLE PARTITION OF</command> will use that tablespace,
-      unless the <literal>TABLESPACE</literal> clause is used to override it.
+      unless overridden by its <literal>TABLESPACE</literal> clause.
      </para>
 
      <para>
diff --git a/doc/src/sgml/ref/pg_rewind.sgml b/doc/src/sgml/ref/pg_rewind.sgml
index 07c49e4719..acdefe58b8 100644
--- a/doc/src/sgml/ref/pg_rewind.sgml
+++ b/doc/src/sgml/ref/pg_rewind.sgml
@@ -215,7 +215,7 @@ PostgreSQL documentation
         <command>pg_rewind</command> to return without waiting, which is
         faster, but means that a subsequent operating system crash can leave
         the synchronized data directory corrupt.  Generally, this option is
-        useful for testing but should not be used when creating a production
+        useful for testing but should not be used on a production
         installation.
        </para>
       </listitem>
@@ -309,7 +309,7 @@ GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, b
   <para>
    When executing <application>pg_rewind</application> using an online
    cluster as source which has been recently promoted, it is necessary
-   to execute a <command>CHECKPOINT</command> after promotion so as its
+   to execute a <command>CHECKPOINT</command> after promotion such that its
    control file reflects up-to-date timeline information, which is used by
    <application>pg_rewind</application> to check if the target cluster
    can be rewound using the designated source cluster.
diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml
index c54a7c420d..bde5eca164 100644
--- a/doc/src/sgml/ref/reindex.sgml
+++ b/doc/src/sgml/ref/reindex.sgml
@@ -249,7 +249,7 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
   <para>
    Reindexing a single index or table requires being the owner of that
    index or table.  Reindexing a schema or database requires being the
-   owner of that schema or database.  Note that is therefore sometimes
+   owner of that schema or database.  Note specifically that it's
    possible for non-superusers to rebuild indexes of tables owned by
    other users.  However, as a special exception, when
    <command>REINDEX DATABASE</command>, <command>REINDEX SCHEMA</command>
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index a34d31d297..3f90c15f3e 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -2643,7 +2643,7 @@ openssl x509 -req -in server.csr -text -days 365 \
    <para>
     The <productname>PostgreSQL</productname> server will listen for both
     normal and <acronym>GSSAPI</acronym>-encrypted connections on the same TCP
-    port, and will negotiate with any connecting client on whether to
+    port, and will negotiate with any connecting client whether to
     use <acronym>GSSAPI</acronym> for encryption (and for authentication).  By
     default, this decision is up to the client (which means it can be
     downgraded by an attacker); see <xref linkend="auth-pg-hba-conf"/> about
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 283c3e0357..25f79d2a1f 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -373,7 +373,7 @@ ereport(ERROR,
      specify suppression of the <literal>CONTEXT:</literal> portion of a message in
      the postmaster log.  This should only be used for verbose debugging
      messages where the repeated inclusion of context would bloat the log
-     volume too much.
+     too much.
     </para>
    </listitem>
   </itemizedlist>
@@ -518,7 +518,7 @@ Hint:       the addendum
    <title>Use of Quotes</title>
 
    <para>
-    Use quotes always to delimit file names, user-supplied identifiers, and
+    Always use quotes to delimit file names, user-supplied identifiers, and
     other variables that might contain words.  Do not use them to mark up
     variables that will not contain words (for example, operator names).
    </para>
-- 
2.17.0

v1-0019-is-vs-are-plural.patchtext/x-diff; charset=us-asciiDownload
From 55e442e0b22b8806b97889eca67044ea5638d40a Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 4 Apr 2019 18:57:48 -0500
Subject: [PATCH v1 19/19] is vs are plural

Should backpatch to v12
---
 doc/src/sgml/auto-explain.sgml    | 4 ++--
 doc/src/sgml/func.sgml            | 2 +-
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 doc/src/sgml/sources.sgml         | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/src/sgml/auto-explain.sgml b/doc/src/sgml/auto-explain.sgml
index d4d29c4a64..828a2d102c 100644
--- a/doc/src/sgml/auto-explain.sgml
+++ b/doc/src/sgml/auto-explain.sgml
@@ -200,8 +200,8 @@ LOAD 'auto_explain';
     <listitem>
      <para>
       <varname>auto_explain.log_settings</varname> controls whether information
-      about modified configuration options are printed when execution plan is logged.
-      Only options affecting query planning with value different from the built-in
+      about modified configuration options is printed when an execution plan is logged.
+      Only those options which affect query planning and whose value differs from its built-in
       default value are included in the output.  This parameter is off by default.
       Only superusers can change this setting.
      </para>
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index b708b79229..1d6016ff73 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -10006,7 +10006,7 @@ gen_random_uuid() returns uuid
    <title>Producing XML Content</title>
 
    <para>
-    A set of functions and function-like expressions are available for
+    A set of functions and function-like expressions is available for
     producing XML content from SQL data.  As such, they are
     particularly suitable for formatting query results into XML
     documents for processing in client applications.
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index fe0f077d1f..0beb08a5a2 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -884,7 +884,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       from the parent table will be created in the partition, if they don't
       already exist.
       If any of the <literal>CHECK</literal> constraints of the table being
-      attached is marked <literal>NO INHERIT</literal>, the command will fail;
+      attached are marked <literal>NO INHERIT</literal>, the command will fail;
       such constraints must be recreated without the
       <literal>NO INHERIT</literal> clause.
      </para>
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 25f79d2a1f..5a8dbcb4d3 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -466,8 +466,8 @@ Hint:       the addendum
     enough for error messages.  Detail and hint messages can be relegated to a
     verbose mode, or perhaps a pop-up error-details window.  Also, details and
     hints would normally be suppressed from the server log to save
-    space. Reference to implementation details is best avoided since users
-    aren't expected to know the details.
+    space. References to implementation details are best avoided since users
+    aren't expected to know them.
    </para>
 
   </simplesect>
-- 
2.17.0

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

On Wed, Apr 08, 2020 at 11:56:53AM -0500, Justin Pryzby wrote:

I previously mailed separately about a few individual patches, some of which
have separate, ongoing discussion and aren't included here (incr sort, parallel
vacuum).

I have gone through your changes, and committed what looked like the
most obvious mistakes in my view. Please see below for more
comments.

 required pages to remove both downlink and rightlink are already  locked.  That
-evades potential right to left page locking order, which could deadlock with
+avoid potential right to left page locking order, which could deadlock with
Not sure which one is better, but the new change is grammatically
incorrect.
       <varname>auto_explain.log_settings</varname> controls whether information
-      about modified configuration options are printed when execution plan is logged.
-      Only options affecting query planning with value different from the built-in
+      about modified configuration options is printed when an execution plan is logged.
+      Only those options which affect query planning and whose value differs from its built-in
Depends on how you read the sentence, but here is seemt to me that 
"statistics" is the correct subject, no?
-        replication is disabled.  Abrupt streaming client disconnection might
+        replication is disabled.  Abrupt disconnection of a streaming client might
Original looks correct to me here.
     <literal>_tz</literal> suffix. These functions have been implemented to
-    support comparison of date/time values that involves implicit
+    support comparison of date/time values that involve implicit
The subject is "comparison" here, no?
     may be included. It also stores the size, last modification time, and
-    an optional checksum for each file.
+    optionally a checksum for each file.
The original sounds fine to me as well.

Anything related to imath.c needs to be reported upstream, though I
recall reporting these two already.
--
Michael

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

On Fri, Apr 10, 2020 at 11:27:46AM +0900, Michael Paquier wrote:

On Wed, Apr 08, 2020 at 11:56:53AM -0500, Justin Pryzby wrote:

I previously mailed separately about a few individual patches, some of which
have separate, ongoing discussion and aren't included here (incr sort, parallel
vacuum).

I have gone through your changes, and committed what looked like the
most obvious mistakes in my view. Please see below for more
comments.

Thanks - rebased for cfbot and continued review.

required pages to remove both downlink and rightlink are already  locked.  That
-evades potential right to left page locking order, which could deadlock with
+avoid potential right to left page locking order, which could deadlock with
Not sure which one is better, but the new change is grammatically
incorrect.

Thanks for noticing

"Evades" usually means to act to avoid detection by the government. Like tax
evasion.

<varname>auto_explain.log_settings</varname> controls whether information
-      about modified configuration options are printed when execution plan is logged.
-      Only options affecting query planning with value different from the built-in
+      about modified configuration options is printed when an execution plan is logged.
+      Only those options which affect query planning and whose value differs from its built-in
Depends on how you read the sentence, but here is seemt to me that 
"statistics" is the correct subject, no?

Statistics ?

<literal>_tz</literal> suffix. These functions have been implemented to
-    support comparison of date/time values that involves implicit
+    support comparison of date/time values that involve implicit
The subject is "comparison" here, no?

You're right.

--
Justin

Attachments:

v2-0001-doc-psql-opclass-opfamily.patchtext/x-diff; charset=us-asciiDownload
From e18b7dbdb3b75047540691929a7ef2b55c0b58e2 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 19:51:32 -0500
Subject: [PATCH v2 01/12] doc: psql opclass/opfamily

commit b0b5e20cd8d1a58a8782d5dc806a5232db116e2f
Author: Alexander Korotkov <akorotkov@postgresql.org>

ALSO, should we rename the "Purpose" column?  I see we have pg_amop.amoppurpose
so maybe it's fine ?
---
 doc/src/sgml/ref/psql-ref.sgml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 0595d1c04b..cdd24fad98 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1244,7 +1244,7 @@ testdb=&gt;
         (see <xref linkend="catalog-pg-opclass"/>).
         If <replaceable class="parameter">access-method-patttern</replaceable>
         is specified, only operator classes associated with access methods whose
-        names match pattern are listed.
+        names match the pattern are listed.
         If <replaceable class="parameter">input-type-pattern</replaceable>
         is specified, only operator classes associated with input types whose
         names match the pattern are listed.
@@ -1267,7 +1267,7 @@ testdb=&gt;
         (see <xref linkend="catalog-pg-opfamily"/>).
         If <replaceable class="parameter">access-method-patttern</replaceable>
         is specified, only operator families associated with access methods whose
-        names match pattern are listed.
+        names match the pattern are listed.
         If <replaceable class="parameter">input-type-pattern</replaceable>
         is specified, only operator families associated with input types whose
         names match the pattern are listed.
@@ -1291,7 +1291,7 @@ testdb=&gt;
         (<xref linkend="catalog-pg-amop"/>).
         If <replaceable class="parameter">access-method-patttern</replaceable>
         is specified, only members of operator families associated with access
-        methods whose names match pattern are listed.
+        methods whose names match the pattern are listed.
         If <replaceable class="parameter">input-type-pattern</replaceable>
         is specified, only members of operator families whose names match the
         pattern are listed.
@@ -1314,7 +1314,7 @@ testdb=&gt;
         (<xref linkend="catalog-pg-amproc"/>).
         If <replaceable class="parameter">access-method-patttern</replaceable>
         is specified, only members of operator families associated with access
-        methods whose names match pattern are listed.
+        methods whose names match the pattern are listed.
         If <replaceable class="parameter">input-type-pattern</replaceable>
         is specified, only members of operator families whose names match the
         pattern are listed.
-- 
2.17.0

v2-0002-doc-percent-encoding.patchtext/x-diff; charset=us-asciiDownload
From 650c29ca5ce500337bd0ff7345f9cfcb60dd596a Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 21:31:08 -0500
Subject: [PATCH v2 02/12] doc: percent encoding

commit e0ed6817c0ee218a3681920807404603e042ff04
Author: Michael Paquier <michael@paquier.xyz>
---
 doc/src/sgml/libpq.sgml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 75d2224a61..8b9af95c14 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -925,11 +925,11 @@ postgresql:///mydb?host=localhost&amp;port=5433
    </para>
 
    <para>
-    Connection <acronym>URI</acronym> needs to be encoded with 
+    A connection <acronym>URI</acronym> needs to be encoded with 
     <ulink url="https://tools.ietf.org/html/rfc3986#section-2.1">Percent-encoding</ulink> 
-    if it includes symbols with special meaning in any of its parts. 
-    Here is an example where equal sign (<literal>=</literal>) is replaced
-    with <literal>%3D</literal> and whitespace character with
+    if it includes symbols with special meanings in any of its parts. 
+    Here is an example where an equal sign (<literal>=</literal>) is replaced
+    with <literal>%3D</literal> and a whitespace character with
     <literal>%20</literal>:
 <programlisting>
 postgresql://user@localhost:5433/mydb?options=-c%20synchronous_commit%3Doff
-- 
2.17.0

v2-0003-docs-btree-deduplication.patchtext/x-diff; charset=us-asciiDownload
From acc729928b3e62b2958ec4686e3d2a6be09cbe3c Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 30 Mar 2020 19:43:22 -0500
Subject: [PATCH v2 03/12] docs: btree deduplication

commit 0d861bbb702f8aa05c2a4e3f1650e7e8df8c8c27
Author: Peter Geoghegan <pg@bowt.ie>
---
 doc/src/sgml/btree.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/btree.sgml b/doc/src/sgml/btree.sgml
index e9cab4a55d..ff1e49e509 100644
--- a/doc/src/sgml/btree.sgml
+++ b/doc/src/sgml/btree.sgml
@@ -609,7 +609,7 @@ equalimage(<replaceable>opcintype</replaceable> <type>oid</type>) returns bool
   </para>
   <para>
    Deduplication works by periodically merging groups of duplicate
-   tuples together, forming a single posting list tuple for each
+   tuples together, forming a single <firstterm>posting list</firstterm> tuple for each
    group.  The column key value(s) only appear once in this
    representation.  This is followed by a sorted array of
    <acronym>TID</acronym>s that point to rows in the table.  This
-- 
2.17.0

v2-0004-doc-pg_stat_progress_basebackup.patchtext/x-diff; charset=us-asciiDownload
From 18a26eb43ce2667e60e4d8f342f1ec5f7c142b9f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 21:22:43 -0500
Subject: [PATCH v2 04/12] doc: pg_stat_progress_basebackup

commit e65497df8f85ab9b9084c928ff69f384ea729b24
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index c50b72137f..3ad1fd7005 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -4483,7 +4483,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
    is taking a base backup, the
    <structname>pg_stat_progress_basebackup</structname>
    view will contain a row for each WAL sender process that is currently
-   running <command>BASE_BACKUP</command> replication command
+   running the <command>BASE_BACKUP</command> replication command
    and streaming the backup. The tables below describe the information
    that will be reported and provide information about how to interpret it.
   </para>
@@ -4577,8 +4577,8 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
       <entry><literal>waiting for checkpoint to finish</literal></entry>
       <entry>
        The WAL sender process is currently performing
-       <function>pg_start_backup</function> to set up for
-       taking a base backup, and waiting for backup start
+       <function>pg_start_backup</function> to prepare to
+       take a base backup, and waiting for the start-of-backup
        checkpoint to finish.
       </entry>
      </row>
-- 
2.17.0

v2-0005-docs-backup-manifests.patchtext/x-diff; charset=us-asciiDownload
From 151322043518a2b493cfafc6eafee9cb4c9f4e29 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 3 Apr 2020 16:17:28 -0500
Subject: [PATCH v2 05/12] docs: backup manifests

commit 0d8c9c1210c44b36ec2efcb223a1dfbe897a3661
Author: Robert Haas <rhaas@postgresql.org>
---
 doc/src/sgml/protocol.sgml              | 4 ++--
 doc/src/sgml/ref/pg_basebackup.sgml     | 4 ++--
 doc/src/sgml/ref/pg_validatebackup.sgml | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 536de9a698..d84afb7b18 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2586,7 +2586,7 @@ The commands accepted in replication mode are:
           and sent along with the backup.  The manifest is a list of every
           file present in the backup with the exception of any WAL files that
           may be included. It also stores the size, last modification time, and
-          an optional checksum for each file.
+          optionally a checksum for each file.
           A value of <literal>force-escape</literal> forces all filenames
           to be hex-encoded; otherwise, this type of encoding is performed only
           for files whose names are non-UTF8 octet sequences.
@@ -2602,7 +2602,7 @@ The commands accepted in replication mode are:
         <term><literal>MANIFEST_CHECKSUMS</literal></term>
         <listitem>
          <para>
-          Specifies the algorithm that should be applied to each file included
+          Specifies the checksum algorithm that should be applied to each file included
           in the backup manifest. Currently, the available
           algorithms are <literal>NONE</literal>, <literal>CRC32C</literal>,
           <literal>SHA224</literal>, <literal>SHA256</literal>,
diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index d9c981cebb..16fa29f293 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -604,7 +604,7 @@ PostgreSQL documentation
         not contain any checksums. Otherwise, it will contain a checksum
         of each file in the backup using the specified algorithm. In addition,
         the manifest will always contain a <literal>SHA256</literal>
-        checksum of its own contents. The <literal>SHA</literal> algorithms
+        checksum of its own content. The <literal>SHA</literal> algorithms
         are significantly more CPU-intensive than <literal>CRC32C</literal>,
         so selecting one of them may increase the time required to complete
         the backup.
@@ -614,7 +614,7 @@ PostgreSQL documentation
         of each file for users who wish to verify that the backup has not been
         tampered with, while the CRC32C algorithm provides a checksum which is
         much faster to calculate and good at catching errors due to accidental
-        changes but is not resistant to targeted modifications.  Note that, to
+        changes but is not resistant to malicious modifications.  Note that, to
         be useful against an adversary who has access to the backup, the backup
         manifest would need to be stored securely elsewhere or otherwise
         verified not to have been modified since the backup was taken.
diff --git a/doc/src/sgml/ref/pg_validatebackup.sgml b/doc/src/sgml/ref/pg_validatebackup.sgml
index 5c626200f6..8dccd9eba4 100644
--- a/doc/src/sgml/ref/pg_validatebackup.sgml
+++ b/doc/src/sgml/ref/pg_validatebackup.sgml
@@ -42,11 +42,11 @@ PostgreSQL documentation
 
   <para>
    It is important to note that the validation which is performed by
-   <application>pg_validatebackup</application> does not and can not include
+   <application>pg_validatebackup</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
-   expected and that they appear to contain the correct data. However,
+   expected and that they contain the correct data. However,
    <application>pg_validatebackup</application> can detect many problems
    that commonly occur due to storage problems or user error.
   </para>
@@ -84,7 +84,7 @@ PostgreSQL documentation
    for any files for which the computed checksum does not match the
    checksum stored in the manifest. This step is not performed for any files
    which produced errors in the previous step, since they are already known
-   to have problems. Also, files which were ignored in the previous step are
+   to have problems. Files which were ignored in the previous step are
    also ignored in this step.
   </para>
 
@@ -123,7 +123,7 @@ PostgreSQL documentation
   <title>Options</title>
 
    <para>
-    The following command-line options control the behavior.
+    The following command-line options control the behavior of this program.
 
     <variablelist>
      <varlistentry>
-- 
2.17.0

v2-0006-Fix-docs-time-of-the.patchtext/x-diff; charset=us-asciiDownload
From e13cbe0fe82c2d5d518730c25665d9e813cbe194 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 5 Apr 2020 22:35:09 -0500
Subject: [PATCH v2 06/12] Fix docs: "time of the"

commit 9e257a181cc1dc5e19eb5d770ce09cc98f470f5f
Author: Andrew Dunstan <andrew@dunslane.net>
Date:   Sun Mar 24 11:27:20 2013 -0400

    Add parallel pg_dump option.

commit 5ab892c391c6bc54a00e7a8de5cab077cabace6a
Author: Michael Paquier <michael@paquier.xyz>
Date:   Sat Jul 27 22:21:18 2019 +0900

    Add support for --jobs in reindexdb

commit a17923204736d8842eade3517d6a8ee81290fca4
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:   Fri Jan 23 15:02:45 2015 -0300

    vacuumdb: enable parallel mode
---
 doc/src/sgml/ref/pg_dump.sgml   | 2 +-
 doc/src/sgml/ref/reindexdb.sgml | 4 ++--
 doc/src/sgml/ref/vacuumdb.sgml  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index a9bc397165..d58cd05f46 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -323,7 +323,7 @@ PostgreSQL documentation
       <listitem>
        <para>
         Run the dump in parallel by dumping <replaceable class="parameter">njobs</replaceable>
-        tables simultaneously. This option reduces the time of the dump but it also
+        tables simultaneously. This option reduces the duration of the dump but it also
         increases the load on the database server. You can only use this option with the
         directory output format because this is the only output format where multiple processes
         can write their data at the same time.
diff --git a/doc/src/sgml/ref/reindexdb.sgml b/doc/src/sgml/ref/reindexdb.sgml
index f6c3d9538b..4388d1329c 100644
--- a/doc/src/sgml/ref/reindexdb.sgml
+++ b/doc/src/sgml/ref/reindexdb.sgml
@@ -173,8 +173,8 @@ PostgreSQL documentation
        <para>
         Execute the reindex commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option reduces the processing time
+        but it also increases the load on the database server.
        </para>
        <para>
         <application>reindexdb</application> will open
diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml
index fd1dc140ab..93a3eed813 100644
--- a/doc/src/sgml/ref/vacuumdb.sgml
+++ b/doc/src/sgml/ref/vacuumdb.sgml
@@ -155,8 +155,8 @@ PostgreSQL documentation
        <para>
         Execute the vacuum or analyze commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option reduces the processing
+        duration but it also increases the load on the database server.
        </para>
        <para>
         <application>vacuumdb</application> will open
-- 
2.17.0

v2-0007-docs-Add-wait-events-for-recovery-conflicts.patchtext/x-diff; charset=us-asciiDownload
From c4f8e158c567402149d8b4aefd22dd6e96cd1186 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 5 Apr 2020 22:55:46 -0500
Subject: [PATCH v2 07/12] docs: Add wait events for recovery conflicts.

commit 18808f8c893d4f425f2d21b2a1ffc8e51f1bd0ba
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 3ad1fd7005..1a7b56b120 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1484,11 +1484,11 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
         </row>
         <row>
          <entry><literal>RecoveryConflictSnapshot</literal></entry>
-         <entry>Waiting for recovery conflict resolution on a vacuum cleanup.</entry>
+         <entry>Waiting for recovery conflict resolution during vacuum cleanup.</entry>
         </row>
         <row>
          <entry><literal>RecoveryConflictTablespace</literal></entry>
-         <entry>Waiting for recovery conflict resolution on dropping tablespace.</entry>
+         <entry>Waiting for recovery conflict resolution while dropping tablespace.</entry>
         </row>
         <row>
          <entry><literal>RecoveryPause</literal></entry>
-- 
2.17.0

v2-0008-doc-Allow-users-to-limit-storage-reserved-by-repl.patchtext/x-diff; charset=us-asciiDownload
From 937965735de236a526701165262540011895dce1 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 7 Apr 2020 19:56:56 -0500
Subject: [PATCH v2 08/12] doc: Allow users to limit storage reserved by
 replication slots

commit c6550776394e25c1620bc8258427c8f1d448080d
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
---
 doc/src/sgml/config.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index a71ca62463..62324f7280 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3790,9 +3790,9 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         slots</link> are allowed to retain in the <filename>pg_wal</filename>
         directory at checkpoint time.
         If <varname>max_slot_wal_keep_size</varname> is -1 (the default),
-        replication slots retain unlimited amount of WAL files.  If
-        restart_lsn of a replication slot gets behind more than that megabytes
-        from the current LSN, the standby using the slot may no longer be able
+        replication slots retain unlimited amount of WAL files.  Otherwise, if
+        restart_lsn of a replication slot falls behind the current LSN by more
+        than the specified size, the standby using the slot may no longer be able
         to continue replication due to removal of required WAL files. You
         can see the WAL availability of replication slots
         in <link linkend="view-pg-replication-slots">pg_replication_slots</link>.
-- 
2.17.0

v2-0009-docs-s-evade-avoid.patchtext/x-diff; charset=us-asciiDownload
From c9915c0a5475b9cb64687f038af238c62465ba6b Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 6 Apr 2020 17:16:07 -0500
Subject: [PATCH v2 09/12] docs: s/evade/avoid/

---
 src/backend/access/gin/README         | 2 +-
 src/backend/utils/adt/jsonpath_exec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/access/gin/README b/src/backend/access/gin/README
index 125a82219b..41d4e1e8a0 100644
--- a/src/backend/access/gin/README
+++ b/src/backend/access/gin/README
@@ -413,7 +413,7 @@ leftmost leaf of the tree.
 Deletion algorithm keeps exclusive locks on left siblings of pages comprising
 currently investigated path.  Thus, if current page is to be removed, all
 required pages to remove both downlink and rightlink are already locked.  That
-evades potential right to left page locking order, which could deadlock with
+avoids potential right to left page locking order, which could deadlock with
 concurrent stepping right.
 
 A search concurrent to page deletion might already have read a pointer to the
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index bc063061cf..0faa66551f 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -35,7 +35,7 @@
  * executeItemOptUnwrapTarget() function have 'unwrap' argument, which indicates
  * whether unwrapping of array is needed.  When unwrap == true, each of array
  * members is passed to executeItemOptUnwrapTarget() again but with unwrap == false
- * in order to evade subsequent array unwrapping.
+ * in order to avoid subsequent array unwrapping.
  *
  * All boolean expressions (predicates) are evaluated by executeBoolItem()
  * function, which returns tri-state JsonPathBool.  When error is occurred
-- 
2.17.0

v2-0010-doc-2014-pg_basebackup-Add-support-for-relocating.patchtext/x-diff; charset=us-asciiDownload
From 054ddb66d92817d2268da7a82c1ddf7ab9e6ae4a Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 26 Feb 2020 12:33:32 -0600
Subject: [PATCH v2 10/12] doc(2014): pg_basebackup: Add support for relocating
 tablespaces

commit fb05f3ce83d225dd0f39f8860ce04082753e9e98
Author: Peter Eisentraut <peter_e@gmx.net>
---
 doc/src/sgml/ref/pg_basebackup.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index 16fa29f293..922688e227 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -808,7 +808,7 @@ PostgreSQL documentation
   </para>
 
   <para>
-   Tablespaces will in plain format by default be backed up to the same path
+   In plain format, tablespaces will by default be backed up to the same path
    they have on the server, unless the
    option <literal>--tablespace-mapping</literal> is used.  Without
    this option, running a plain format base backup on the same host as the
-- 
2.17.0

v2-0011-Say-it-more-naturally.patchtext/x-diff; charset=us-asciiDownload
From f3bbc7e29a44b99b14e440ec183a156296e96d91 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 9 Jul 2019 10:42:26 -0500
Subject: [PATCH v2 11/12] Say it more naturally

Originally submitted here and never integrated.
https://www.postgresql.org/message-id/flat/20190427025647.GD3925%40telsasoft.com#e1731c33455145eadc1158042cc411f9

Should backpatch to v12
---
 doc/src/sgml/config.sgml          | 2 +-
 doc/src/sgml/ddl.sgml             | 2 +-
 doc/src/sgml/libpq.sgml           | 2 +-
 doc/src/sgml/monitoring.sgml      | 6 +++---
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 doc/src/sgml/ref/pg_rewind.sgml   | 4 ++--
 doc/src/sgml/ref/reindex.sgml     | 2 +-
 doc/src/sgml/runtime.sgml         | 2 +-
 doc/src/sgml/sources.sgml         | 4 ++--
 9 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 62324f7280..1237a88b02 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3667,7 +3667,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         servers or streaming base backup clients (i.e., the maximum number of
         simultaneously running WAL sender processes). The default is
         <literal>10</literal>.  The value <literal>0</literal> means
-        replication is disabled.  Abrupt streaming client disconnection might
+        replication is disabled.  Abrupt disconnection of a streaming client might
         leave an orphaned connection slot behind until a timeout is reached,
         so this parameter should be set slightly higher than the maximum
         number of expected clients so disconnected clients can immediately
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index ab27645319..f61d366d1d 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3959,7 +3959,7 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02
      Before running the <command>ATTACH PARTITION</command> command, it is
      recommended to create a <literal>CHECK</literal> constraint on the table to
      be attached matching the desired partition constraint. That way,
-     the system will be able to skip the scan to validate the implicit
+     the system will be able to skip the scan which is otherwise needed to validate the implicit
      partition constraint. Without the <literal>CHECK</literal> constraint,
      the table will be scanned to validate the partition constraint while
      holding an <literal>ACCESS EXCLUSIVE</literal> lock on that partition
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 8b9af95c14..b9c789eb6f 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -1223,7 +1223,7 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
       <term><literal>connect_timeout</literal></term>
       <listitem>
       <para>
-       Maximum wait for connection, in seconds (write as a decimal integer,
+       Maximum time to wait while connecting, in seconds (write as a decimal integer,
        e.g. <literal>10</literal>).  Zero, negative, or not specified means
        wait indefinitely.  The minimum allowed timeout is 2 seconds, therefore
        a value of <literal>1</literal> is interpreted as <literal>2</literal>.
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 1a7b56b120..52264853eb 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -2596,14 +2596,14 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <row>
      <entry><structfield>datname</structfield></entry>
      <entry><type>name</type></entry>
-     <entry>Name of this database, or <literal>NULL</literal> for the shared
+     <entry>Name of this database, or <literal>NULL</literal> for shared
      objects.</entry>
     </row>
     <row>
      <entry><structfield>numbackends</structfield></entry>
      <entry><type>integer</type></entry>
      <entry>Number of backends currently connected to this database, or
-     <literal>NULL</literal> for the shared objects.  This is the only column
+     <literal>NULL</literal> for shared objects.  This is the only column
      in this view that returns a value reflecting current state; all other
      columns return the accumulated values since the last reset.</entry>
     </row>
@@ -2725,7 +2725,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
 
   <para>
    The <structname>pg_stat_database</structname> view will contain one row
-   for each database in the cluster, plus one for the shared objects, showing
+   for each database in the cluster, plus one for shared objects, showing
    database-wide statistics.
   </para>
 
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index e486196477..fe0f077d1f 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -666,7 +666,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       When applied to a partitioned table, nothing is moved, but any
       partitions created afterwards with
       <command>CREATE TABLE PARTITION OF</command> will use that tablespace,
-      unless the <literal>TABLESPACE</literal> clause is used to override it.
+      unless overridden by its <literal>TABLESPACE</literal> clause.
      </para>
 
      <para>
diff --git a/doc/src/sgml/ref/pg_rewind.sgml b/doc/src/sgml/ref/pg_rewind.sgml
index 07c49e4719..acdefe58b8 100644
--- a/doc/src/sgml/ref/pg_rewind.sgml
+++ b/doc/src/sgml/ref/pg_rewind.sgml
@@ -215,7 +215,7 @@ PostgreSQL documentation
         <command>pg_rewind</command> to return without waiting, which is
         faster, but means that a subsequent operating system crash can leave
         the synchronized data directory corrupt.  Generally, this option is
-        useful for testing but should not be used when creating a production
+        useful for testing but should not be used on a production
         installation.
        </para>
       </listitem>
@@ -309,7 +309,7 @@ GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, b
   <para>
    When executing <application>pg_rewind</application> using an online
    cluster as source which has been recently promoted, it is necessary
-   to execute a <command>CHECKPOINT</command> after promotion so as its
+   to execute a <command>CHECKPOINT</command> after promotion such that its
    control file reflects up-to-date timeline information, which is used by
    <application>pg_rewind</application> to check if the target cluster
    can be rewound using the designated source cluster.
diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml
index c54a7c420d..bde5eca164 100644
--- a/doc/src/sgml/ref/reindex.sgml
+++ b/doc/src/sgml/ref/reindex.sgml
@@ -249,7 +249,7 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
   <para>
    Reindexing a single index or table requires being the owner of that
    index or table.  Reindexing a schema or database requires being the
-   owner of that schema or database.  Note that is therefore sometimes
+   owner of that schema or database.  Note specifically that it's
    possible for non-superusers to rebuild indexes of tables owned by
    other users.  However, as a special exception, when
    <command>REINDEX DATABASE</command>, <command>REINDEX SCHEMA</command>
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index a34d31d297..3f90c15f3e 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -2643,7 +2643,7 @@ openssl x509 -req -in server.csr -text -days 365 \
    <para>
     The <productname>PostgreSQL</productname> server will listen for both
     normal and <acronym>GSSAPI</acronym>-encrypted connections on the same TCP
-    port, and will negotiate with any connecting client on whether to
+    port, and will negotiate with any connecting client whether to
     use <acronym>GSSAPI</acronym> for encryption (and for authentication).  By
     default, this decision is up to the client (which means it can be
     downgraded by an attacker); see <xref linkend="auth-pg-hba-conf"/> about
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 283c3e0357..25f79d2a1f 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -373,7 +373,7 @@ ereport(ERROR,
      specify suppression of the <literal>CONTEXT:</literal> portion of a message in
      the postmaster log.  This should only be used for verbose debugging
      messages where the repeated inclusion of context would bloat the log
-     volume too much.
+     too much.
     </para>
    </listitem>
   </itemizedlist>
@@ -518,7 +518,7 @@ Hint:       the addendum
    <title>Use of Quotes</title>
 
    <para>
-    Use quotes always to delimit file names, user-supplied identifiers, and
+    Always use quotes to delimit file names, user-supplied identifiers, and
     other variables that might contain words.  Do not use them to mark up
     variables that will not contain words (for example, operator names).
    </para>
-- 
2.17.0

v2-0012-is-vs-are-plural.patchtext/x-diff; charset=us-asciiDownload
From cba309e855aadb4ef16b3cc48bfe32c19d5d1c68 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 4 Apr 2019 18:57:48 -0500
Subject: [PATCH v2 12/12] is vs are plural

Should backpatch to v12
---
 doc/src/sgml/auto-explain.sgml    | 6 +++---
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 doc/src/sgml/sources.sgml         | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/src/sgml/auto-explain.sgml b/doc/src/sgml/auto-explain.sgml
index d4d29c4a64..de2be61bff 100644
--- a/doc/src/sgml/auto-explain.sgml
+++ b/doc/src/sgml/auto-explain.sgml
@@ -200,9 +200,9 @@ LOAD 'auto_explain';
     <listitem>
      <para>
       <varname>auto_explain.log_settings</varname> controls whether information
-      about modified configuration options are printed when execution plan is logged.
-      Only options affecting query planning with value different from the built-in
-      default value are included in the output.  This parameter is off by default.
+      about modified configuration options is printed when an execution plan is logged.
+      Only those options which affect query planning and whose value differs from their
+      built-in default are included in the output.  This parameter is off by default.
       Only superusers can change this setting.
      </para>
     </listitem>
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index fe0f077d1f..0beb08a5a2 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -884,7 +884,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       from the parent table will be created in the partition, if they don't
       already exist.
       If any of the <literal>CHECK</literal> constraints of the table being
-      attached is marked <literal>NO INHERIT</literal>, the command will fail;
+      attached are marked <literal>NO INHERIT</literal>, the command will fail;
       such constraints must be recreated without the
       <literal>NO INHERIT</literal> clause.
      </para>
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 25f79d2a1f..5a8dbcb4d3 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -466,8 +466,8 @@ Hint:       the addendum
     enough for error messages.  Detail and hint messages can be relegated to a
     verbose mode, or perhaps a pop-up error-details window.  Also, details and
     hints would normally be suppressed from the server log to save
-    space. Reference to implementation details is best avoided since users
-    aren't expected to know the details.
+    space. References to implementation details are best avoided since users
+    aren't expected to know them.
    </para>
 
   </simplesect>
-- 
2.17.0

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

On Thu, Apr 09, 2020 at 10:01:51PM -0500, Justin Pryzby wrote:

On Fri, Apr 10, 2020 at 11:27:46AM +0900, Michael Paquier wrote:

required pages to remove both downlink and rightlink are already  locked.  That
-evades potential right to left page locking order, which could deadlock with
+avoid potential right to left page locking order, which could deadlock with
Not sure which one is better, but the new change is grammatically
incorrect.

"Evades" usually means to act to avoid detection by the government. Like tax
evasion.

This change is from Alexander Korotkov as of 32ca32d, so I am adding
him in CC to get his opinion.

<varname>auto_explain.log_settings</varname> controls whether information
-      about modified configuration options are printed when execution plan is logged.
-      Only options affecting query planning with value different from the built-in
+      about modified configuration options is printed when an execution plan is logged.
+      Only those options which affect query planning and whose value differs from its built-in
Depends on how you read the sentence, but here is seemt to me that 
"statistics" is the correct subject, no?

Statistics ?

Oops. I may have messed up with a different part of the patch set.
Your suggestion is right as the subject is "information" here.
--
Michael

#5Justin Pryzby
pryzby@telsasoft.com
In reply to: Michael Paquier (#4)
19 attachment(s)
Re: doc review for v13

Added a few more.
And rebased on top of dbc60c5593f26dc777a3be032bff4fb4eab1ddd1

--
Justin

Attachments:

v3-0001-doc-psql-opclass-opfamily.patchtext/x-diff; charset=us-asciiDownload
From 37b796862eb8c08dbe0d1a6947a8212d1c515491 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 19:51:32 -0500
Subject: [PATCH v3 01/20] doc: psql opclass/opfamily

commit b0b5e20cd8d1a58a8782d5dc806a5232db116e2f
Author: Alexander Korotkov <akorotkov@postgresql.org>
---
 doc/src/sgml/ref/psql-ref.sgml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 0595d1c04b..cdd24fad98 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1244,7 +1244,7 @@ testdb=&gt;
         (see <xref linkend="catalog-pg-opclass"/>).
         If <replaceable class="parameter">access-method-patttern</replaceable>
         is specified, only operator classes associated with access methods whose
-        names match pattern are listed.
+        names match the pattern are listed.
         If <replaceable class="parameter">input-type-pattern</replaceable>
         is specified, only operator classes associated with input types whose
         names match the pattern are listed.
@@ -1267,7 +1267,7 @@ testdb=&gt;
         (see <xref linkend="catalog-pg-opfamily"/>).
         If <replaceable class="parameter">access-method-patttern</replaceable>
         is specified, only operator families associated with access methods whose
-        names match pattern are listed.
+        names match the pattern are listed.
         If <replaceable class="parameter">input-type-pattern</replaceable>
         is specified, only operator families associated with input types whose
         names match the pattern are listed.
@@ -1291,7 +1291,7 @@ testdb=&gt;
         (<xref linkend="catalog-pg-amop"/>).
         If <replaceable class="parameter">access-method-patttern</replaceable>
         is specified, only members of operator families associated with access
-        methods whose names match pattern are listed.
+        methods whose names match the pattern are listed.
         If <replaceable class="parameter">input-type-pattern</replaceable>
         is specified, only members of operator families whose names match the
         pattern are listed.
@@ -1314,7 +1314,7 @@ testdb=&gt;
         (<xref linkend="catalog-pg-amproc"/>).
         If <replaceable class="parameter">access-method-patttern</replaceable>
         is specified, only members of operator families associated with access
-        methods whose names match pattern are listed.
+        methods whose names match the pattern are listed.
         If <replaceable class="parameter">input-type-pattern</replaceable>
         is specified, only members of operator families whose names match the
         pattern are listed.
-- 
2.17.0

v3-0002-doc-percent-encoding.patchtext/x-diff; charset=us-asciiDownload
From 05526ece41acad552697753a156f161a4253c831 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 21:31:08 -0500
Subject: [PATCH v3 02/20] doc: percent encoding

commit e0ed6817c0ee218a3681920807404603e042ff04
Author: Michael Paquier <michael@paquier.xyz>
---
 doc/src/sgml/libpq.sgml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 75d2224a61..8b9af95c14 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -925,11 +925,11 @@ postgresql:///mydb?host=localhost&amp;port=5433
    </para>
 
    <para>
-    Connection <acronym>URI</acronym> needs to be encoded with 
+    A connection <acronym>URI</acronym> needs to be encoded with 
     <ulink url="https://tools.ietf.org/html/rfc3986#section-2.1">Percent-encoding</ulink> 
-    if it includes symbols with special meaning in any of its parts. 
-    Here is an example where equal sign (<literal>=</literal>) is replaced
-    with <literal>%3D</literal> and whitespace character with
+    if it includes symbols with special meanings in any of its parts. 
+    Here is an example where an equal sign (<literal>=</literal>) is replaced
+    with <literal>%3D</literal> and a whitespace character with
     <literal>%20</literal>:
 <programlisting>
 postgresql://user@localhost:5433/mydb?options=-c%20synchronous_commit%3Doff
-- 
2.17.0

v3-0003-docs-btree-deduplication.patchtext/x-diff; charset=us-asciiDownload
From 290c309de4ce3ac3103cd527406c75165db4c4e0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 30 Mar 2020 19:43:22 -0500
Subject: [PATCH v3 03/20] docs: btree deduplication

commit 0d861bbb702f8aa05c2a4e3f1650e7e8df8c8c27
Author: Peter Geoghegan <pg@bowt.ie>
---
 doc/src/sgml/btree.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/btree.sgml b/doc/src/sgml/btree.sgml
index e9cab4a55d..ff1e49e509 100644
--- a/doc/src/sgml/btree.sgml
+++ b/doc/src/sgml/btree.sgml
@@ -609,7 +609,7 @@ equalimage(<replaceable>opcintype</replaceable> <type>oid</type>) returns bool
   </para>
   <para>
    Deduplication works by periodically merging groups of duplicate
-   tuples together, forming a single posting list tuple for each
+   tuples together, forming a single <firstterm>posting list</firstterm> tuple for each
    group.  The column key value(s) only appear once in this
    representation.  This is followed by a sorted array of
    <acronym>TID</acronym>s that point to rows in the table.  This
-- 
2.17.0

v3-0004-doc-pg_stat_progress_basebackup.patchtext/x-diff; charset=us-asciiDownload
From d683b732ab33b3d7f3664a870ad52ca78f44041f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 21:22:43 -0500
Subject: [PATCH v3 04/20] doc: pg_stat_progress_basebackup

commit e65497df8f85ab9b9084c928ff69f384ea729b24
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index c50b72137f..3ad1fd7005 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -4483,7 +4483,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
    is taking a base backup, the
    <structname>pg_stat_progress_basebackup</structname>
    view will contain a row for each WAL sender process that is currently
-   running <command>BASE_BACKUP</command> replication command
+   running the <command>BASE_BACKUP</command> replication command
    and streaming the backup. The tables below describe the information
    that will be reported and provide information about how to interpret it.
   </para>
@@ -4577,8 +4577,8 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
       <entry><literal>waiting for checkpoint to finish</literal></entry>
       <entry>
        The WAL sender process is currently performing
-       <function>pg_start_backup</function> to set up for
-       taking a base backup, and waiting for backup start
+       <function>pg_start_backup</function> to prepare to
+       take a base backup, and waiting for the start-of-backup
        checkpoint to finish.
       </entry>
      </row>
-- 
2.17.0

v3-0005-Fix-docs-time-of-the.patchtext/x-diff; charset=us-asciiDownload
From 6cf9ba8538ab7a5bc76550f0d237b51b2ccf6a9c Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 5 Apr 2020 22:35:09 -0500
Subject: [PATCH v3 05/20] Fix docs: "time of the"

commit 9e257a181cc1dc5e19eb5d770ce09cc98f470f5f
Author: Andrew Dunstan <andrew@dunslane.net>
Date:   Sun Mar 24 11:27:20 2013 -0400

    Add parallel pg_dump option.

commit 5ab892c391c6bc54a00e7a8de5cab077cabace6a
Author: Michael Paquier <michael@paquier.xyz>
Date:   Sat Jul 27 22:21:18 2019 +0900

    Add support for --jobs in reindexdb

commit a17923204736d8842eade3517d6a8ee81290fca4
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:   Fri Jan 23 15:02:45 2015 -0300

    vacuumdb: enable parallel mode
---
 doc/src/sgml/ref/pg_dump.sgml   | 2 +-
 doc/src/sgml/ref/reindexdb.sgml | 4 ++--
 doc/src/sgml/ref/vacuumdb.sgml  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index a9bc397165..d58cd05f46 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -323,7 +323,7 @@ PostgreSQL documentation
       <listitem>
        <para>
         Run the dump in parallel by dumping <replaceable class="parameter">njobs</replaceable>
-        tables simultaneously. This option reduces the time of the dump but it also
+        tables simultaneously. This option reduces the duration of the dump but it also
         increases the load on the database server. You can only use this option with the
         directory output format because this is the only output format where multiple processes
         can write their data at the same time.
diff --git a/doc/src/sgml/ref/reindexdb.sgml b/doc/src/sgml/ref/reindexdb.sgml
index f6c3d9538b..4388d1329c 100644
--- a/doc/src/sgml/ref/reindexdb.sgml
+++ b/doc/src/sgml/ref/reindexdb.sgml
@@ -173,8 +173,8 @@ PostgreSQL documentation
        <para>
         Execute the reindex commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option reduces the processing time
+        but it also increases the load on the database server.
        </para>
        <para>
         <application>reindexdb</application> will open
diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml
index fd1dc140ab..93a3eed813 100644
--- a/doc/src/sgml/ref/vacuumdb.sgml
+++ b/doc/src/sgml/ref/vacuumdb.sgml
@@ -155,8 +155,8 @@ PostgreSQL documentation
        <para>
         Execute the vacuum or analyze commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option reduces the processing
+        duration but it also increases the load on the database server.
        </para>
        <para>
         <application>vacuumdb</application> will open
-- 
2.17.0

v3-0006-docs-Add-wait-events-for-recovery-conflicts.patchtext/x-diff; charset=us-asciiDownload
From 00f1dca124527ff3bd414acc5d1c0cd2cf225913 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 5 Apr 2020 22:55:46 -0500
Subject: [PATCH v3 06/20] docs: Add wait events for recovery conflicts.

commit 18808f8c893d4f425f2d21b2a1ffc8e51f1bd0ba
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 3ad1fd7005..1a7b56b120 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1484,11 +1484,11 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
         </row>
         <row>
          <entry><literal>RecoveryConflictSnapshot</literal></entry>
-         <entry>Waiting for recovery conflict resolution on a vacuum cleanup.</entry>
+         <entry>Waiting for recovery conflict resolution during vacuum cleanup.</entry>
         </row>
         <row>
          <entry><literal>RecoveryConflictTablespace</literal></entry>
-         <entry>Waiting for recovery conflict resolution on dropping tablespace.</entry>
+         <entry>Waiting for recovery conflict resolution while dropping tablespace.</entry>
         </row>
         <row>
          <entry><literal>RecoveryPause</literal></entry>
-- 
2.17.0

v3-0007-doc-Allow-users-to-limit-storage-reserved-by-repl.patchtext/x-diff; charset=us-asciiDownload
From b301f7004c66ea82fed4ee321050020375dd8905 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 7 Apr 2020 19:56:56 -0500
Subject: [PATCH v3 07/20] doc: Allow users to limit storage reserved by
 replication slots

commit c6550776394e25c1620bc8258427c8f1d448080d
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
---
 doc/src/sgml/config.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index a71ca62463..62324f7280 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3790,9 +3790,9 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         slots</link> are allowed to retain in the <filename>pg_wal</filename>
         directory at checkpoint time.
         If <varname>max_slot_wal_keep_size</varname> is -1 (the default),
-        replication slots retain unlimited amount of WAL files.  If
-        restart_lsn of a replication slot gets behind more than that megabytes
-        from the current LSN, the standby using the slot may no longer be able
+        replication slots retain unlimited amount of WAL files.  Otherwise, if
+        restart_lsn of a replication slot falls behind the current LSN by more
+        than the specified size, the standby using the slot may no longer be able
         to continue replication due to removal of required WAL files. You
         can see the WAL availability of replication slots
         in <link linkend="view-pg-replication-slots">pg_replication_slots</link>.
-- 
2.17.0

v3-0008-docs-s-evade-avoid.patchtext/x-diff; charset=us-asciiDownload
From 900e19bcf8e7bab1904e7ffeb4a5f8afc2fa7676 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 6 Apr 2020 17:16:07 -0500
Subject: [PATCH v3 08/20] docs: s/evade/avoid/

---
 src/backend/access/gin/README         | 2 +-
 src/backend/utils/adt/jsonpath_exec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/access/gin/README b/src/backend/access/gin/README
index 125a82219b..41d4e1e8a0 100644
--- a/src/backend/access/gin/README
+++ b/src/backend/access/gin/README
@@ -413,7 +413,7 @@ leftmost leaf of the tree.
 Deletion algorithm keeps exclusive locks on left siblings of pages comprising
 currently investigated path.  Thus, if current page is to be removed, all
 required pages to remove both downlink and rightlink are already locked.  That
-evades potential right to left page locking order, which could deadlock with
+avoids potential right to left page locking order, which could deadlock with
 concurrent stepping right.
 
 A search concurrent to page deletion might already have read a pointer to the
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index bc063061cf..0faa66551f 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -35,7 +35,7 @@
  * executeItemOptUnwrapTarget() function have 'unwrap' argument, which indicates
  * whether unwrapping of array is needed.  When unwrap == true, each of array
  * members is passed to executeItemOptUnwrapTarget() again but with unwrap == false
- * in order to evade subsequent array unwrapping.
+ * in order to avoid subsequent array unwrapping.
  *
  * All boolean expressions (predicates) are evaluated by executeBoolItem()
  * function, which returns tri-state JsonPathBool.  When error is occurred
-- 
2.17.0

v3-0009-doc-Support-FETCH-FIRST-WITH-TIES.patchtext/x-diff; charset=us-asciiDownload
From 66675f635a1c527814e835229a671583c2c734ee Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 10:00:10 -0500
Subject: [PATCH v3 09/20] doc: Support FETCH FIRST WITH TIES

commit 357889eb17bb9c9336c4f324ceb1651da616fe57
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
---
 doc/src/sgml/ref/select.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml
index 2b11c38087..767f2a806c 100644
--- a/doc/src/sgml/ref/select.sgml
+++ b/doc/src/sgml/ref/select.sgml
@@ -1449,7 +1449,7 @@ FETCH { FIRST | NEXT } [ <replaceable class="parameter">count</replaceable> ] {
     If <replaceable class="parameter">count</replaceable> is
     omitted in a <literal>FETCH</literal> clause, it defaults to 1.
     The <literal>WITH TIES</literal> option is used to return any additional
-    rows that tie for the last place in the result set according to
+    rows that tie for the last place in the result set according to the
     <literal>ORDER BY</literal> clause; <literal>ORDER BY</literal>
     is mandatory in this case.
     <literal>ROW</literal> and <literal>ROWS</literal> as well as
-- 
2.17.0

v3-0010-doc-Allow-publishing-partition-changes-via-ancest.patchtext/x-diff; charset=us-asciiDownload
From fe65adb6204c13c4ae8864b9f2574fdd722861e7 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 10:03:05 -0500
Subject: [PATCH v3 10/20] doc: Allow publishing partition changes via
 ancestors

commit 83fd4532a72179c370e318075a10e0e2aa832024
Author: Peter Eisentraut <peter@eisentraut.org>
---
 doc/src/sgml/ref/create_publication.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/create_publication.sgml b/doc/src/sgml/ref/create_publication.sgml
index 2c52a8aada..473bfb6e56 100644
--- a/doc/src/sgml/ref/create_publication.sgml
+++ b/doc/src/sgml/ref/create_publication.sgml
@@ -132,7 +132,7 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable>
           on its partitions) contained in the publication will be published
           using the identity and schema of the partitioned table rather than
           that of the individual partitions that are actually changed; the
-          latter is the default.  Enablings this allows the changes to be
+          latter is the default.  Enabling this allows the changes to be
           replicated into a non-partitioned table or a partitioned table
           consisting of a different set of partitions.
          </para>
-- 
2.17.0

v3-0011-doc-Add-logical-replication-support-to-replicate-.patchtext/x-diff; charset=us-asciiDownload
From ed7b6de40d760c88af0b9be596dc516990e1f39d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 10:05:21 -0500
Subject: [PATCH v3 11/20] doc: Add logical replication support to replicate
 into partitioned tables

commit f1ac27bfda6ce8a399d8001843e9aefff5814f9b
Author: Peter Eisentraut <peter@eisentraut.org>
---
 doc/src/sgml/logical-replication.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index eba331a72b..faf6d56bed 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -404,7 +404,7 @@
     <para>
      Replication is only supported by tables, including partitioned tables.
      Attempts to replicate other types of relations such as views, materialized
-     views, or foreign tables, will result in an error.
+     views, or foreign tables will result in an error.
     </para>
    </listitem>
 
-- 
2.17.0

v3-0012-comment-typo-Add-logical-replication-support-to-r.patchtext/x-diff; charset=us-asciiDownload
From 9edd65fdee4caef01b4d4341243a8a038074d598 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 11 Apr 2020 20:57:43 -0500
Subject: [PATCH v3 12/20] comment typo: Add logical replication support to
 replicate into partitioned tables

commit f1ac27bfda6ce8a399d8001843e9aefff5814f9b
Author: Peter Eisentraut <peter@eisentraut.org>
Date:   Mon Apr 6 15:15:52 2020 +0200

    Add logical replication support to replicate into partitioned tables
---
 src/backend/replication/logical/relation.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c
index 2e7b755aeb..351b0950c0 100644
--- a/src/backend/replication/logical/relation.c
+++ b/src/backend/replication/logical/relation.c
@@ -575,7 +575,7 @@ logicalrep_partmap_init(void)
  * Returned entry reuses most of the values of the root table's entry, save
  * the attribute map, which can be different for the partition.
  *
- * Note there's no logialrep_partition_close, because the caller closes the
+ * Note there's no logicalrep_partition_close, because the caller closes the
  * the component relation.
  */
 LogicalRepRelMapEntry *
@@ -631,7 +631,7 @@ logicalrep_partition_open(LogicalRepRelMapEntry *root,
 	/*
 	 * If the partition's attributes don't match the root relation's, we'll
 	 * need to make a new attrmap which maps partition attribute numbers to
-	 * remoterel's, instead the original which maps root relation's attribute
+	 * remoterel's, instead of the original which maps root relation's attribute
 	 * numbers to remoterel's.
 	 *
 	 * Note that 'map' which comes from the tuple routing data structure
-- 
2.17.0

v3-0013-docs-backup-manifests.patchtext/x-diff; charset=us-asciiDownload
From 42d0e6cb2ed2d75d6f213c9cbc1d69fa62840607 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 3 Apr 2020 16:17:28 -0500
Subject: [PATCH v3 13/20] docs: backup manifests

commit 0d8c9c1210c44b36ec2efcb223a1dfbe897a3661
Author: Robert Haas <rhaas@postgresql.org>

Previously reported here:
https://www.postgresql.org/message-id/20200403212445.GB12283%40telsasoft.com
---
 doc/src/sgml/protocol.sgml            | 4 ++--
 doc/src/sgml/ref/pg_basebackup.sgml   | 4 ++--
 doc/src/sgml/ref/pg_verifybackup.sgml | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index c1b2457b1d..95ed74ddcf 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2586,7 +2586,7 @@ The commands accepted in replication mode are:
           and sent along with the backup.  The manifest is a list of every
           file present in the backup with the exception of any WAL files that
           may be included. It also stores the size, last modification time, and
-          an optional checksum for each file.
+          optionally a checksum for each file.
           A value of <literal>force-escape</literal> forces all filenames
           to be hex-encoded; otherwise, this type of encoding is performed only
           for files whose names are non-UTF8 octet sequences.
@@ -2602,7 +2602,7 @@ The commands accepted in replication mode are:
         <term><literal>MANIFEST_CHECKSUMS</literal></term>
         <listitem>
          <para>
-          Specifies the algorithm that should be applied to each file included
+          Specifies the checksum algorithm that should be applied to each file included
           in the backup manifest. Currently, the available
           algorithms are <literal>NONE</literal>, <literal>CRC32C</literal>,
           <literal>SHA224</literal>, <literal>SHA256</literal>,
diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index 01ce44ee22..76cb34991c 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -604,7 +604,7 @@ PostgreSQL documentation
         not contain any checksums. Otherwise, it will contain a checksum
         of each file in the backup using the specified algorithm. In addition,
         the manifest will always contain a <literal>SHA256</literal>
-        checksum of its own contents. The <literal>SHA</literal> algorithms
+        checksum of its own content. The <literal>SHA</literal> algorithms
         are significantly more CPU-intensive than <literal>CRC32C</literal>,
         so selecting one of them may increase the time required to complete
         the backup.
@@ -614,7 +614,7 @@ PostgreSQL documentation
         of each file for users who wish to verify that the backup has not been
         tampered with, while the CRC32C algorithm provides a checksum which is
         much faster to calculate and good at catching errors due to accidental
-        changes but is not resistant to targeted modifications.  Note that, to
+        changes but is not resistant to malicious modifications.  Note that, to
         be useful against an adversary who has access to the backup, the backup
         manifest would need to be stored securely elsewhere or otherwise
         verified not to have been modified since the backup was taken.
diff --git a/doc/src/sgml/ref/pg_verifybackup.sgml b/doc/src/sgml/ref/pg_verifybackup.sgml
index 0ab92b38f7..541d3528a4 100644
--- a/doc/src/sgml/ref/pg_verifybackup.sgml
+++ b/doc/src/sgml/ref/pg_verifybackup.sgml
@@ -41,12 +41,12 @@ PostgreSQL documentation
   </para>
 
   <para>
-   It is important to note that that the validation which is performed by
+   It is important to note that the validation which is performed by
    <application>pg_verifybackup</application> does not and can not 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
-   expected and that they appear to contain the correct data. However,
+   expected and that they contain the correct data. However,
    <application>pg_verifybackup</application> can detect many problems
    that commonly occur due to storage problems or user error.
   </para>
@@ -84,7 +84,7 @@ PostgreSQL documentation
    for any files for which the computed checksum does not match the
    checksum stored in the manifest. This step is not performed for any files
    which produced errors in the previous step, since they are already known
-   to have problems. Also, files which were ignored in the previous step are
+   to have problems. Files which were ignored in the previous step are
    also ignored in this step.
   </para>
 
@@ -123,7 +123,7 @@ PostgreSQL documentation
   <title>Options</title>
 
    <para>
-    The following command-line options control the behavior.
+    The following command-line options control the behavior of this program.
 
     <variablelist>
      <varlistentry>
-- 
2.17.0

v3-0014-Say-re-sent-not-resent.patchtext/x-diff; charset=us-asciiDownload
From d5c19b92debc6ed7c5618e0ec1317ce2a0e7ca0b Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 21:14:47 -0500
Subject: [PATCH v3 14/20] Say "re-sent" not "resent"..

..which means "feel bitter or indignant about"
---
 doc/src/sgml/logicaldecoding.sgml         | 2 +-
 doc/src/sgml/ref/create_subscription.sgml | 2 +-
 src/backend/storage/lmgr/proc.c           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index bad3bfe620..e08ae9e2af 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -223,7 +223,7 @@ $ pg_recvlogical -d postgres --slot=test --drop-slot
      A logical slot will emit each change just once in normal operation.
      The current position of each slot is persisted only at checkpoint, so in
      the case of a crash the slot may return to an earlier LSN, which will
-     then cause recent changes to be resent when the server restarts.
+     then cause recent changes to be re-sent when the server restarts.
      Logical decoding clients are responsible for avoiding ill effects from
      handling the same message more than once.  Clients may wish to record
      the last LSN they saw when decoding and skip over any repeated data or
diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml
index 1a90c244fb..c18618d5c8 100644
--- a/doc/src/sgml/ref/create_subscription.sgml
+++ b/doc/src/sgml/ref/create_subscription.sgml
@@ -159,7 +159,7 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
          <para>
           It is safe to use <literal>off</literal> for logical replication:
           If the subscriber loses transactions because of missing
-          synchronization, the data will be resent from the publisher.
+          synchronization, the data will be re-sent from the publisher.
          </para>
 
          <para>
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index 5aa19d3f78..22fe566f48 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -1373,7 +1373,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
 			else
 				LWLockRelease(ProcArrayLock);
 
-			/* prevent signal from being resent more than once */
+			/* prevent signal from being re-sent more than once */
 			allow_autovacuum_cancel = false;
 		}
 
-- 
2.17.0

v3-0015-doc-2014-pg_basebackup-Add-support-for-relocating.patchtext/x-diff; charset=us-asciiDownload
From 8b39acdef8979e06bbfa4fb26078877e8273cc15 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 26 Feb 2020 12:33:32 -0600
Subject: [PATCH v3 15/20] doc(2014): pg_basebackup: Add support for relocating
 tablespaces

commit fb05f3ce83d225dd0f39f8860ce04082753e9e98
Author: Peter Eisentraut <peter_e@gmx.net>
---
 doc/src/sgml/ref/pg_basebackup.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index 76cb34991c..b742470f13 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -808,7 +808,7 @@ PostgreSQL documentation
   </para>
 
   <para>
-   Tablespaces will in plain format by default be backed up to the same path
+   In plain format, tablespaces will by default be backed up to the same path
    they have on the server, unless the
    option <literal>--tablespace-mapping</literal> is used.  Without
    this option, running a plain format base backup on the same host as the
-- 
2.17.0

v3-0016-Say-it-more-naturally.patchtext/x-diff; charset=us-asciiDownload
From 36c4b7a41362c875516e467c38791224736e0a73 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 9 Jul 2019 10:42:26 -0500
Subject: [PATCH v3 16/20] Say it more naturally

Originally submitted here and never integrated.
https://www.postgresql.org/message-id/flat/20190427025647.GD3925%40telsasoft.com#e1731c33455145eadc1158042cc411f9

Should backpatch to v12
---
 doc/src/sgml/config.sgml          | 2 +-
 doc/src/sgml/ddl.sgml             | 2 +-
 doc/src/sgml/libpq.sgml           | 2 +-
 doc/src/sgml/monitoring.sgml      | 6 +++---
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 doc/src/sgml/ref/pg_rewind.sgml   | 4 ++--
 doc/src/sgml/ref/reindex.sgml     | 2 +-
 doc/src/sgml/runtime.sgml         | 2 +-
 doc/src/sgml/sources.sgml         | 4 ++--
 9 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 62324f7280..1237a88b02 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3667,7 +3667,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         servers or streaming base backup clients (i.e., the maximum number of
         simultaneously running WAL sender processes). The default is
         <literal>10</literal>.  The value <literal>0</literal> means
-        replication is disabled.  Abrupt streaming client disconnection might
+        replication is disabled.  Abrupt disconnection of a streaming client might
         leave an orphaned connection slot behind until a timeout is reached,
         so this parameter should be set slightly higher than the maximum
         number of expected clients so disconnected clients can immediately
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index ab27645319..f61d366d1d 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3959,7 +3959,7 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02
      Before running the <command>ATTACH PARTITION</command> command, it is
      recommended to create a <literal>CHECK</literal> constraint on the table to
      be attached matching the desired partition constraint. That way,
-     the system will be able to skip the scan to validate the implicit
+     the system will be able to skip the scan which is otherwise needed to validate the implicit
      partition constraint. Without the <literal>CHECK</literal> constraint,
      the table will be scanned to validate the partition constraint while
      holding an <literal>ACCESS EXCLUSIVE</literal> lock on that partition
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 8b9af95c14..b9c789eb6f 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -1223,7 +1223,7 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
       <term><literal>connect_timeout</literal></term>
       <listitem>
       <para>
-       Maximum wait for connection, in seconds (write as a decimal integer,
+       Maximum time to wait while connecting, in seconds (write as a decimal integer,
        e.g. <literal>10</literal>).  Zero, negative, or not specified means
        wait indefinitely.  The minimum allowed timeout is 2 seconds, therefore
        a value of <literal>1</literal> is interpreted as <literal>2</literal>.
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 1a7b56b120..52264853eb 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -2596,14 +2596,14 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
     <row>
      <entry><structfield>datname</structfield></entry>
      <entry><type>name</type></entry>
-     <entry>Name of this database, or <literal>NULL</literal> for the shared
+     <entry>Name of this database, or <literal>NULL</literal> for shared
      objects.</entry>
     </row>
     <row>
      <entry><structfield>numbackends</structfield></entry>
      <entry><type>integer</type></entry>
      <entry>Number of backends currently connected to this database, or
-     <literal>NULL</literal> for the shared objects.  This is the only column
+     <literal>NULL</literal> for shared objects.  This is the only column
      in this view that returns a value reflecting current state; all other
      columns return the accumulated values since the last reset.</entry>
     </row>
@@ -2725,7 +2725,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
 
   <para>
    The <structname>pg_stat_database</structname> view will contain one row
-   for each database in the cluster, plus one for the shared objects, showing
+   for each database in the cluster, plus one for shared objects, showing
    database-wide statistics.
   </para>
 
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index 7595e609b5..9c136dbce3 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -671,7 +671,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       When applied to a partitioned table, nothing is moved, but any
       partitions created afterwards with
       <command>CREATE TABLE PARTITION OF</command> will use that tablespace,
-      unless the <literal>TABLESPACE</literal> clause is used to override it.
+      unless overridden by its <literal>TABLESPACE</literal> clause.
      </para>
 
      <para>
diff --git a/doc/src/sgml/ref/pg_rewind.sgml b/doc/src/sgml/ref/pg_rewind.sgml
index 07c49e4719..acdefe58b8 100644
--- a/doc/src/sgml/ref/pg_rewind.sgml
+++ b/doc/src/sgml/ref/pg_rewind.sgml
@@ -215,7 +215,7 @@ PostgreSQL documentation
         <command>pg_rewind</command> to return without waiting, which is
         faster, but means that a subsequent operating system crash can leave
         the synchronized data directory corrupt.  Generally, this option is
-        useful for testing but should not be used when creating a production
+        useful for testing but should not be used on a production
         installation.
        </para>
       </listitem>
@@ -309,7 +309,7 @@ GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, b
   <para>
    When executing <application>pg_rewind</application> using an online
    cluster as source which has been recently promoted, it is necessary
-   to execute a <command>CHECKPOINT</command> after promotion so as its
+   to execute a <command>CHECKPOINT</command> after promotion such that its
    control file reflects up-to-date timeline information, which is used by
    <application>pg_rewind</application> to check if the target cluster
    can be rewound using the designated source cluster.
diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml
index c54a7c420d..bde5eca164 100644
--- a/doc/src/sgml/ref/reindex.sgml
+++ b/doc/src/sgml/ref/reindex.sgml
@@ -249,7 +249,7 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
   <para>
    Reindexing a single index or table requires being the owner of that
    index or table.  Reindexing a schema or database requires being the
-   owner of that schema or database.  Note that is therefore sometimes
+   owner of that schema or database.  Note specifically that it's
    possible for non-superusers to rebuild indexes of tables owned by
    other users.  However, as a special exception, when
    <command>REINDEX DATABASE</command>, <command>REINDEX SCHEMA</command>
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index a34d31d297..3f90c15f3e 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -2643,7 +2643,7 @@ openssl x509 -req -in server.csr -text -days 365 \
    <para>
     The <productname>PostgreSQL</productname> server will listen for both
     normal and <acronym>GSSAPI</acronym>-encrypted connections on the same TCP
-    port, and will negotiate with any connecting client on whether to
+    port, and will negotiate with any connecting client whether to
     use <acronym>GSSAPI</acronym> for encryption (and for authentication).  By
     default, this decision is up to the client (which means it can be
     downgraded by an attacker); see <xref linkend="auth-pg-hba-conf"/> about
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 283c3e0357..25f79d2a1f 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -373,7 +373,7 @@ ereport(ERROR,
      specify suppression of the <literal>CONTEXT:</literal> portion of a message in
      the postmaster log.  This should only be used for verbose debugging
      messages where the repeated inclusion of context would bloat the log
-     volume too much.
+     too much.
     </para>
    </listitem>
   </itemizedlist>
@@ -518,7 +518,7 @@ Hint:       the addendum
    <title>Use of Quotes</title>
 
    <para>
-    Use quotes always to delimit file names, user-supplied identifiers, and
+    Always use quotes to delimit file names, user-supplied identifiers, and
     other variables that might contain words.  Do not use them to mark up
     variables that will not contain words (for example, operator names).
    </para>
-- 
2.17.0

v3-0017-is-vs-are-plural.patchtext/x-diff; charset=us-asciiDownload
From 1152763fd14bdcef593b334235f3c4285b5805ce Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 4 Apr 2019 18:57:48 -0500
Subject: [PATCH v3 17/20] is vs are plural

Should backpatch to v12
---
 doc/src/sgml/auto-explain.sgml    | 6 +++---
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 doc/src/sgml/sources.sgml         | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/src/sgml/auto-explain.sgml b/doc/src/sgml/auto-explain.sgml
index d4d29c4a64..de2be61bff 100644
--- a/doc/src/sgml/auto-explain.sgml
+++ b/doc/src/sgml/auto-explain.sgml
@@ -200,9 +200,9 @@ LOAD 'auto_explain';
     <listitem>
      <para>
       <varname>auto_explain.log_settings</varname> controls whether information
-      about modified configuration options are printed when execution plan is logged.
-      Only options affecting query planning with value different from the built-in
-      default value are included in the output.  This parameter is off by default.
+      about modified configuration options is printed when an execution plan is logged.
+      Only those options which affect query planning and whose value differs from their
+      built-in default are included in the output.  This parameter is off by default.
       Only superusers can change this setting.
      </para>
     </listitem>
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index 9c136dbce3..f74eb049cc 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -889,7 +889,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       from the parent table will be created in the partition, if they don't
       already exist.
       If any of the <literal>CHECK</literal> constraints of the table being
-      attached is marked <literal>NO INHERIT</literal>, the command will fail;
+      attached are marked <literal>NO INHERIT</literal>, the command will fail;
       such constraints must be recreated without the
       <literal>NO INHERIT</literal> clause.
      </para>
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 25f79d2a1f..5a8dbcb4d3 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -466,8 +466,8 @@ Hint:       the addendum
     enough for error messages.  Detail and hint messages can be relegated to a
     verbose mode, or perhaps a pop-up error-details window.  Also, details and
     hints would normally be suppressed from the server log to save
-    space. Reference to implementation details is best avoided since users
-    aren't expected to know the details.
+    space. References to implementation details are best avoided since users
+    aren't expected to know them.
    </para>
 
   </simplesect>
-- 
2.17.0

v3-0018-doc-Rename-the-recovery-related-wait-events.patchtext/x-diff; charset=us-asciiDownload
From 85c51fd71286dba3ff3ca8e091f2c3ed04d664b3 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 09:02:15 -0500
Subject: [PATCH v3 18/20] doc: Rename the recovery-related wait events.

commit 1d253bae57fcb3e75cdd9cdb2592c5b09cf7e7b7
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 52264853eb..3cabc24721 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1526,9 +1526,9 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
         <row>
          <entry><literal>RecoveryRetrieveRetryInterval</literal></entry>
          <entry>
-          Waiting when WAL data is not available from any kind of sources
-          (<filename>pg_wal</filename>, archive or stream) before trying
-          again to retrieve WAL data, at recovery.
+          Waiting in recovery when WAL data is not available from any source
+          (<filename>pg_wal</filename>, archive or stream) before re-trying
+          to retrieve WAL data.
          </entry>
         </row>
         <row>
-- 
2.17.0

v3-0019-comment-typos-and-others-Incremental-Sort.patchtext/x-diff; charset=us-asciiDownload
From 0a1a049855a35b4cd7de3a2d1b3a0773df21d6bd Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 6 Apr 2020 17:37:31 -0500
Subject: [PATCH v3 19/20] comment typos and others: Incremental Sort

commit d2d8a229bc58a2014dce1c7a4fcdb6c5ab9fb8da
Author: Tomas Vondra <tomas.vondra@postgresql.org>

Previously reported here:
https://www.postgresql.org/message-id/20200407042521.GH2228%40telsasoft.com
---
 doc/src/sgml/perform.sgml                  |  2 +-
 src/backend/commands/explain.c             | 13 +++++------
 src/backend/executor/nodeIncrementalSort.c | 26 +++++++++++-----------
 src/backend/utils/sort/tuplesort.c         | 10 ++++-----
 src/include/utils/tuplesort.h              |  2 +-
 5 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml
index 0dfc3e80e2..f448abd073 100644
--- a/doc/src/sgml/perform.sgml
+++ b/doc/src/sgml/perform.sgml
@@ -311,7 +311,7 @@ EXPLAIN SELECT * FROM tenk1 ORDER BY unique1;
    ->  Seq Scan on tenk1  (cost=0.00..445.00 rows=10000 width=244)
 </screen>
 
-    If the a part of the plan guarantess an ordering on a prefix of the
+    If a part of the plan guarantees an ordering on a prefix of the
     required sort keys, then the planner may instead decide to use an
     <literal>incremental sort</literal> step:
 
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index f3c8da1e01..265e9cea8a 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -2532,7 +2532,7 @@ show_sort_group_keys(PlanState *planstate, const char *qlabel,
 
 	ExplainPropertyList(qlabel, result, es);
 	if (nPresortedKeys > 0)
-		ExplainPropertyList("Presorted Key", resultPresorted, es);
+		ExplainPropertyList("Pre-sorted Key", resultPresorted, es);
 }
 
 /*
@@ -2829,7 +2829,6 @@ show_incremental_sort_group_info(IncrementalSortGroupInfo *groupInfo,
 
 		ExplainPropertyList("Sort Methods Used", methodNames, es);
 
-		if (groupInfo->maxMemorySpaceUsed > 0)
 		{
 			long		avgSpace = groupInfo->totalMemorySpaceUsed / groupInfo->groupCount;
 			const char *spaceTypeName;
@@ -2846,7 +2845,7 @@ show_incremental_sort_group_info(IncrementalSortGroupInfo *groupInfo,
 
 			ExplainCloseGroup("Sort Spaces", memoryName.data, true, es);
 		}
-		if (groupInfo->maxDiskSpaceUsed > 0)
+
 		{
 			long		avgSpace = groupInfo->totalDiskSpaceUsed / groupInfo->groupCount;
 			const char *spaceTypeName;
@@ -2869,7 +2868,7 @@ show_incremental_sort_group_info(IncrementalSortGroupInfo *groupInfo,
 }
 
 /*
- * If it's EXPLAIN ANALYZE, show tuplesort stats for a incremental sort node
+ * If it's EXPLAIN ANALYZE, show tuplesort stats for an incremental sort node
  */
 static void
 show_incremental_sort_info(IncrementalSortState *incrsortstate,
@@ -2900,7 +2899,7 @@ show_incremental_sort_info(IncrementalSortState *incrsortstate,
 		{
 			if (es->format == EXPLAIN_FORMAT_TEXT)
 				appendStringInfo(es->str, " ");
-			show_incremental_sort_group_info(prefixsortGroupInfo, "Presorted", false, es);
+			show_incremental_sort_group_info(prefixsortGroupInfo, "Pre-sorted", false, es);
 		}
 		if (es->format == EXPLAIN_FORMAT_TEXT)
 			appendStringInfo(es->str, "\n");
@@ -2917,7 +2916,7 @@ show_incremental_sort_info(IncrementalSortState *incrsortstate,
 			&incrsortstate->shared_info->sinfo[n];
 
 			/*
-			 * If a worker hasn't process any sort groups at all, then exclude
+			 * If a worker hasn't processed any sort groups at all, then exclude
 			 * it from output since it either didn't launch or didn't
 			 * contribute anything meaningful.
 			 */
@@ -2944,7 +2943,7 @@ show_incremental_sort_info(IncrementalSortState *incrsortstate,
 			{
 				if (es->format == EXPLAIN_FORMAT_TEXT)
 					appendStringInfo(es->str, " ");
-				show_incremental_sort_group_info(prefixsortGroupInfo, "Presorted", false, es);
+				show_incremental_sort_group_info(prefixsortGroupInfo, "Pre-sorted", false, es);
 			}
 			if (es->format == EXPLAIN_FORMAT_TEXT)
 				appendStringInfo(es->str, "\n");
diff --git a/src/backend/executor/nodeIncrementalSort.c b/src/backend/executor/nodeIncrementalSort.c
index bcab7c054c..afdec2a0cd 100644
--- a/src/backend/executor/nodeIncrementalSort.c
+++ b/src/backend/executor/nodeIncrementalSort.c
@@ -270,7 +270,7 @@ isCurrentGroup(IncrementalSortState *node, TupleTableSlot *pivot, TupleTableSlot
  * verify they're all part of the same prefix key group before sorting them
  * solely by unsorted suffix keys.
  *
- * While it's likely that all already fetch tuples are all part of a single
+ * While it's likely that all already fetched tuples are all part of a single
  * prefix group, we also have to handle the possibility that there is at least
  * one different prefix key group before the large prefix key group.
  * ----------------------------------------------------------------
@@ -381,7 +381,7 @@ switchToPresortedPrefixMode(PlanState *pstate)
 				 * node->transfer_tuple slot, and, even though that slot
 				 * points to memory inside the full sort tuplesort, we can't
 				 * reset that tuplesort anyway until we've fully transferred
-				 * out of its tuples, so this reference is safe. We do need to
+				 * out its tuples, so this reference is safe. We do need to
 				 * reset the group pivot tuple though since we've finished the
 				 * current prefix key group.
 				 */
@@ -603,7 +603,7 @@ ExecIncrementalSort(PlanState *pstate)
 			/*
 			 * Initialize presorted column support structures for
 			 * isCurrentGroup(). It's correct to do this along with the
-			 * initial intialization for the full sort state (and not for the
+			 * initial initialization for the full sort state (and not for the
 			 * prefix sort state) since we always load the full sort state
 			 * first.
 			 */
@@ -723,7 +723,7 @@ ExecIncrementalSort(PlanState *pstate)
 				nTuples++;
 
 				/*
-				 * If we've reach our minimum group size, then we need to
+				 * If we've reached our minimum group size, then we need to
 				 * store the most recent tuple as a pivot.
 				 */
 				if (nTuples == minGroupSize)
@@ -752,7 +752,7 @@ ExecIncrementalSort(PlanState *pstate)
 				{
 					/*
 					 * Since the tuple we fetched isn't part of the current
-					 * prefix key group we don't want to  sort it as part of
+					 * prefix key group we don't want to sort it as part of
 					 * the current batch. Instead we use the group_pivot slot
 					 * to carry it over to the next batch (even though we
 					 * won't actually treat it as a group pivot).
@@ -792,12 +792,12 @@ ExecIncrementalSort(PlanState *pstate)
 			}
 
 			/*
-			 * Unless we've alrady transitioned modes to reading from the full
+			 * Unless we've already transitioned modes to reading from the full
 			 * sort state, then we assume that having read at least
 			 * DEFAULT_MAX_FULL_SORT_GROUP_SIZE tuples means it's likely we're
 			 * processing a large group of tuples all having equal prefix keys
 			 * (but haven't yet found the final tuple in that prefix key
-			 * group), so we need to transition in to presorted prefix mode.
+			 * group), so we need to transition into presorted prefix mode.
 			 */
 			if (nTuples > DEFAULT_MAX_FULL_SORT_GROUP_SIZE &&
 				node->execution_status != INCSORT_READFULLSORT)
@@ -849,7 +849,7 @@ ExecIncrementalSort(PlanState *pstate)
 
 				/*
 				 * We might have multiple prefix key groups in the full sort
-				 * state, so the mode transition function needs to know the it
+				 * state, so the mode transition function needs to know that it
 				 * needs to move from the fullsort to presorted prefix sort.
 				 */
 				node->n_fullsort_remaining = nTuples;
@@ -913,7 +913,7 @@ ExecIncrementalSort(PlanState *pstate)
 			/*
 			 * If the tuple's prefix keys match our pivot tuple, we're not
 			 * done yet and can load it into the prefix sort state. If not, we
-			 * don't want to  sort it as part of the current batch. Instead we
+			 * don't want to sort it as part of the current batch. Instead we
 			 * use the group_pivot slot to carry it over to the next batch
 			 * (even though we won't actually treat it as a group pivot).
 			 */
@@ -987,7 +987,7 @@ ExecInitIncrementalSort(IncrementalSort *node, EState *estate, int eflags)
 
 	/*
 	 * Incremental sort can't be used with either EXEC_FLAG_REWIND,
-	 * EXEC_FLAG_BACKWARD or EXEC_FLAG_MARK, because we only one of many sort
+	 * EXEC_FLAG_BACKWARD or EXEC_FLAG_MARK, because we only ???? one of many sort
 	 * batches in the current sort state.
 	 */
 	Assert((eflags & (EXEC_FLAG_BACKWARD |
@@ -1121,14 +1121,14 @@ ExecReScanIncrementalSort(IncrementalSortState *node)
 	PlanState  *outerPlan = outerPlanState(node);
 
 	/*
-	 * Incremental sort doesn't support efficient rescan even when paramters
+	 * Incremental sort doesn't support efficient rescan even when parameters
 	 * haven't changed (e.g., rewind) because unlike regular sort we don't
 	 * store all tuples at once for the full sort.
 	 *
 	 * So even if EXEC_FLAG_REWIND is set we just reset all of our state and
 	 * reexecute the sort along with the child node below us.
 	 *
-	 * In theory if we've only fill the full sort with one batch (and haven't
+	 * In theory if we've only filled the full sort with one batch (and haven't
 	 * reset it for a new batch yet) then we could efficiently rewind, but
 	 * that seems a narrow enough case that it's not worth handling specially
 	 * at this time.
@@ -1153,7 +1153,7 @@ ExecReScanIncrementalSort(IncrementalSortState *node)
 	/*
 	 * If we've set up either of the sort states yet, we need to reset them.
 	 * We could end them and null out the pointers, but there's no reason to
-	 * repay the setup cost, and because guard setting up pivot comparator
+	 * repay the setup cost, and because ???? guard setting up pivot comparator
 	 * state similarly, doing so might actually cause a leak.
 	 */
 	if (node->fullsort_state != NULL)
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index cc33a85731..a965fb0025 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -808,7 +808,7 @@ tuplesort_begin_common(int workMem, SortCoordinate coordinate,
  *
  * Setup, or reset, all state need for processing a new set of tuples with this
  * sort state. Called both from tuplesort_begin_common (the first time sorting
- * with this sort state) and tuplesort_reseti (for subsequent usages).
+ * with this sort state) and tuplesort_reset (for subsequent usages).
  */
 static void
 tuplesort_begin_batch(Tuplesortstate *state)
@@ -1428,11 +1428,11 @@ tuplesort_updatemax(Tuplesortstate *state)
 	}
 
 	/*
-	 * Sort evicts data to the disk when it didn't manage to fit those data to
-	 * the main memory.  This is why we assume space used on the disk to be
+	 * Sort evicts data to the disk when it didn't manage to fit the data in
+	 * main memory.  This is why we assume space used on the disk to be
 	 * more important for tracking resource usage than space used in memory.
-	 * Note that amount of space occupied by some tuple set on the disk might
-	 * be less than amount of space occupied by the same tuple set in the
+	 * Note that amount of space occupied by some tupleset on the disk might
+	 * be less than amount of space occupied by the same tupleset in the
 	 * memory due to more compact representation.
 	 */
 	if ((isSpaceDisk && !state->isMaxSpaceDisk) ||
diff --git a/src/include/utils/tuplesort.h b/src/include/utils/tuplesort.h
index 04d263228d..d992b4875a 100644
--- a/src/include/utils/tuplesort.h
+++ b/src/include/utils/tuplesort.h
@@ -63,7 +63,7 @@ typedef struct SortCoordinateData *SortCoordinate;
  * sometimes put it in shared memory.
  *
  * The parallel-sort infrastructure relies on having a zero TuplesortMethod
- * indicate that a worker never did anything, so we assign zero to
+ * to indicate that a worker never did anything, so we assign zero to
  * SORT_TYPE_STILL_IN_PROGRESS.  The other values of this enum can be
  * OR'ed together to represent a situation where different workers used
  * different methods, so we need a separate bit for each one.  Keep the
-- 
2.17.0

#6Michael Paquier
michael@paquier.xyz
In reply to: Justin Pryzby (#5)
Re: doc review for v13

On Sun, Apr 12, 2020 at 04:35:45PM -0500, Justin Pryzby wrote:

Added a few more.
And rebased on top of dbc60c5593f26dc777a3be032bff4fb4eab1ddd1

Thanks for the patch set, I have applied the most obvious parts (more
or less 1/3) to reduce the load. Here is a review of the rest.

@@ -2829,7 +2829,6 @@ show_incremental_sort_group_info(IncrementalSortGroupInfo *groupInfo,

ExplainPropertyList("Sort Methods Used", methodNames, es);

-		if (groupInfo->maxMemorySpaceUsed > 0)
{
long		avgSpace = groupInfo->totalMemorySpaceUsed / groupInfo->groupCount;
const char *spaceTypeName;
@@ -2846,7 +2845,7 @@ show_incremental_sort_group_info(IncrementalSortGroupInfo *groupInfo,

ExplainCloseGroup("Sort Spaces", memoryName.data, true, es);
}
- if (groupInfo->maxDiskSpaceUsed > 0)
+
{
long avgSpace = groupInfo->totalDiskSpaceUsed / groupInfo->groupCount;
const char *spaceTypeName;

If this can be reworked, it seems to me that more cleanup could be
done.

@@ -987,7 +987,7 @@ ExecInitIncrementalSort(IncrementalSort *node, EState *estate, int eflags)

/*
* Incremental sort can't be used with either EXEC_FLAG_REWIND,
-	 * EXEC_FLAG_BACKWARD or EXEC_FLAG_MARK, because we only one of many sort
+	 * EXEC_FLAG_BACKWARD or EXEC_FLAG_MARK, because we only ???? one of many sort
* batches in the current sort state.
*/
Assert((eflags & (EXEC_FLAG_BACKWARD |

The following is inconsistent with this comment block, and I guess
that "????" should be "have":
Assert((eflags & (EXEC_FLAG_BACKWARD |
EXEC_FLAG_MARK)) == 0);
This is only a doc-related change though, so I'll start a different
thread about that after looking more at it.

@@ -1153,7 +1153,7 @@ ExecReScanIncrementalSort(IncrementalSortState *node)
/*
* If we've set up either of the sort states yet, we need to reset them.
* We could end them and null out the pointers, but there's no reason to
-	 * repay the setup cost, and because guard setting up pivot comparator
+	 * repay the setup cost, and because ???? guard setting up pivot comparator
* state similarly, doing so might actually cause a leak.
*/
if (node->fullsort_state != NULL)

I don't quite understand this comment either, but it seems to me that
the last part should be a fully-separate sentence, aka "This guards
against..".

@@ -631,7 +631,7 @@ logicalrep_partition_open(LogicalRepRelMapEntry *root,
/*
* If the partition's attributes don't match the root relation's, we'll
* need to make a new attrmap which maps partition attribute numbers to
-	 * remoterel's, instead the original which maps root relation's attribute
+	 * remoterel's, instead of the original which maps root relation's attribute
* numbers to remoterel's.
*
* Note that 'map' which comes from the tuple routing data structure

Okay, this is not really clear to start with. I think that I would
rewrite that completely as follows:
"If the partition's attributes do not match the root relation's
attributes, we cannot use the original attribute map which maps the
root relation's attributes with remoterel's attributes. Instead,
build a new attribute map which maps the partition's attributes with
remoterel's attributes."

+++ b/src/backend/storage/lmgr/proc.c
@@ -1373,7 +1373,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
else
LWLockRelease(ProcArrayLock);
-			/* prevent signal from being resent more than once */
+			/* prevent signal from being re-sent more than once */
allow_autovacuum_cancel = false;
}

Shouldn't that just be "sent more than two times"?

@@ -1428,11 +1428,11 @@ tuplesort_updatemax(Tuplesortstate *state)
}

/*
-	 * Sort evicts data to the disk when it didn't manage to fit those data to
-	 * the main memory.  This is why we assume space used on the disk to be
+	 * Sort evicts data to the disk when it didn't manage to fit the data in
+	 * main memory.  This is why we assume space used on the disk to be

Both the original and the suggestion are wrong? It seems to me that
it should be "this data" instead because it refers to the data evicted
in the first part of the sentence.

* more important for tracking resource usage than space used in memory.
-	 * Note that amount of space occupied by some tuple set on the disk might
-	 * be less than amount of space occupied by the same tuple set in the
+	 * Note that amount of space occupied by some tupleset on the disk might
+	 * be less than amount of space occupied by the same tupleset in the
* memory due to more compact representation.
*/
if ((isSpaceDisk && !state->isMaxSpaceDisk) ||

Yep, right.

+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -223,7 +223,7 @@ $ pg_recvlogical -d postgres --slot=test --drop-slot
A logical slot will emit each change just once in normal operation.
The current position of each slot is persisted only at checkpoint, so in
the case of a crash the slot may return to an earlier LSN, which will
-     then cause recent changes to be resent when the server restarts.
+     then cause recent changes to be re-sent when the server restarts.
Logical decoding clients are responsible for avoiding ill effects from
handling the same message more than once.  Clients may wish to record
the last LSN they saw when decoding and skip over any repeated data or

"sent again" instead of "resent" or "re-sent"?

+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -889,7 +889,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
from the parent table will be created in the partition, if they don't
already exist.
If any of the <literal>CHECK</literal> constraints of the table being
-      attached is marked <literal>NO INHERIT</literal>, the command will fail;
+      attached are marked <literal>NO INHERIT</literal>, the command will fail;
such constraints must be recreated without the
<literal>NO INHERIT</literal> clause.
</para>

It seems to me that both are actually correct here.

+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -604,7 +604,7 @@ PostgreSQL documentation
not contain any checksums. Otherwise, it will contain a checksum
of each file in the backup using the specified algorithm. In addition,
the manifest will always contain a <literal>SHA256</literal>
-        checksum of its own contents. The <literal>SHA</literal> algorithms
+        checksum of its own content. The <literal>SHA</literal> algorithms
are significantly more CPU-intensive than <literal>CRC32C</literal>,
so selecting one of them may increase the time required to complete
the backup.

And the original is correct here IMO.

+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1244,7 +1244,7 @@ testdb=&gt;
(see <xref linkend="catalog-pg-opclass"/>).
If <replaceable class="parameter">access-method-patttern</replaceable>
is specified, only operator classes associated with access methods whose
-        names match pattern are listed.
+        names match the pattern are listed.
If <replaceable class="parameter">input-type-pattern</replaceable>
is specified, only operator classes associated with input types whose
names match the pattern are listed.

Another error I see here is that pattern has three 't', while the
original parameter name is correct.

+++ b/doc/src/sgml/runtime.sgml
@@ -2643,7 +2643,7 @@ openssl x509 -req -in server.csr -text -days 365 \
<para>
The <productname>PostgreSQL</productname> server will listen for both
normal and <acronym>GSSAPI</acronym>-encrypted connections on the same TCP
-    port, and will negotiate with any connecting client on whether to
+    port, and will negotiate with any connecting client whether to
use <acronym>GSSAPI</acronym> for encryption (and for authentication).  By
default, this decision is up to the client (which means it can be
downgraded by an attacker); see <xref linkend="auth-pg-hba-conf"/> about

Actually correct?
--
Michael

#7Justin Pryzby
pryzby@telsasoft.com
In reply to: Michael Paquier (#6)
12 attachment(s)
Re: doc review for v13

On Tue, Apr 14, 2020 at 02:47:54PM +0900, Michael Paquier wrote:

On Sun, Apr 12, 2020 at 04:35:45PM -0500, Justin Pryzby wrote:

Added a few more.
And rebased on top of dbc60c5593f26dc777a3be032bff4fb4eab1ddd1

Thanks for the patch set, I have applied the most obvious parts (more
or less 1/3) to reduce the load. Here is a review of the rest.

Thanks - attached are the remaining undisputed portions..

+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -889,7 +889,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
from the parent table will be created in the partition, if they don't
already exist.
If any of the <literal>CHECK</literal> constraints of the table being
-      attached is marked <literal>NO INHERIT</literal>, the command will fail;
+      attached are marked <literal>NO INHERIT</literal>, the command will fail;
such constraints must be recreated without the
<literal>NO INHERIT</literal> clause.
</para>

It seems to me that both are actually correct here.

I think my text is correct. This would *also* be correct:

| If any <literal>CHECK</literal> constraint on the table being
| attached is marked <literal>NO INHERIT</literal>, the command will fail;

But not the hybrid: "If any OF THE .. is .."

--
Justin

Attachments:

v4-0001-doc-percent-encoding.patchtext/x-diff; charset=us-asciiDownload
From 5f499fec02301696705be5b9f6e1b0c4fa1dba16 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 21:31:08 -0500
Subject: [PATCH v4 01/12] doc: percent encoding

commit e0ed6817c0ee218a3681920807404603e042ff04
Author: Michael Paquier <michael@paquier.xyz>
---
 doc/src/sgml/libpq.sgml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 75d2224a61..8b9af95c14 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -925,11 +925,11 @@ postgresql:///mydb?host=localhost&amp;port=5433
    </para>
 
    <para>
-    Connection <acronym>URI</acronym> needs to be encoded with 
+    A connection <acronym>URI</acronym> needs to be encoded with 
     <ulink url="https://tools.ietf.org/html/rfc3986#section-2.1">Percent-encoding</ulink> 
-    if it includes symbols with special meaning in any of its parts. 
-    Here is an example where equal sign (<literal>=</literal>) is replaced
-    with <literal>%3D</literal> and whitespace character with
+    if it includes symbols with special meanings in any of its parts. 
+    Here is an example where an equal sign (<literal>=</literal>) is replaced
+    with <literal>%3D</literal> and a whitespace character with
     <literal>%20</literal>:
 <programlisting>
 postgresql://user@localhost:5433/mydb?options=-c%20synchronous_commit%3Doff
-- 
2.17.0

v4-0002-docs-btree-deduplication.patchtext/x-diff; charset=us-asciiDownload
From 1df7e0445624948b63d776f6894da145db8622cc Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 30 Mar 2020 19:43:22 -0500
Subject: [PATCH v4 02/12] docs: btree deduplication

commit 0d861bbb702f8aa05c2a4e3f1650e7e8df8c8c27
Author: Peter Geoghegan <pg@bowt.ie>
---
 doc/src/sgml/btree.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/btree.sgml b/doc/src/sgml/btree.sgml
index e9cab4a55d..ff1e49e509 100644
--- a/doc/src/sgml/btree.sgml
+++ b/doc/src/sgml/btree.sgml
@@ -609,7 +609,7 @@ equalimage(<replaceable>opcintype</replaceable> <type>oid</type>) returns bool
   </para>
   <para>
    Deduplication works by periodically merging groups of duplicate
-   tuples together, forming a single posting list tuple for each
+   tuples together, forming a single <firstterm>posting list</firstterm> tuple for each
    group.  The column key value(s) only appear once in this
    representation.  This is followed by a sorted array of
    <acronym>TID</acronym>s that point to rows in the table.  This
-- 
2.17.0

v4-0003-doc-pg_stat_progress_basebackup.patchtext/x-diff; charset=us-asciiDownload
From 383aabd1e2fe497f40710904d897f088607e08a2 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 21:22:43 -0500
Subject: [PATCH v4 03/12] doc: pg_stat_progress_basebackup

commit e65497df8f85ab9b9084c928ff69f384ea729b24
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 6562cc400b..d5d9da659d 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -4577,8 +4577,8 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
       <entry><literal>waiting for checkpoint to finish</literal></entry>
       <entry>
        The WAL sender process is currently performing
-       <function>pg_start_backup</function> to set up for
-       taking a base backup, and waiting for backup start
+       <function>pg_start_backup</function> to prepare to
+       take a base backup, and waiting for the start-of-backup
        checkpoint to finish.
       </entry>
      </row>
-- 
2.17.0

v4-0004-Fix-docs-time-of-the.patchtext/x-diff; charset=us-asciiDownload
From 44cc3b9422619ff068e72fbad3f0eec103594717 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 5 Apr 2020 22:35:09 -0500
Subject: [PATCH v4 04/12] Fix docs: "time of the"

commit 9e257a181cc1dc5e19eb5d770ce09cc98f470f5f
Author: Andrew Dunstan <andrew@dunslane.net>
Date:   Sun Mar 24 11:27:20 2013 -0400

    Add parallel pg_dump option.

commit 5ab892c391c6bc54a00e7a8de5cab077cabace6a
Author: Michael Paquier <michael@paquier.xyz>
Date:   Sat Jul 27 22:21:18 2019 +0900

    Add support for --jobs in reindexdb

commit a17923204736d8842eade3517d6a8ee81290fca4
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:   Fri Jan 23 15:02:45 2015 -0300

    vacuumdb: enable parallel mode
---
 doc/src/sgml/ref/pg_dump.sgml   | 2 +-
 doc/src/sgml/ref/reindexdb.sgml | 4 ++--
 doc/src/sgml/ref/vacuumdb.sgml  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index a9bc397165..d58cd05f46 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -323,7 +323,7 @@ PostgreSQL documentation
       <listitem>
        <para>
         Run the dump in parallel by dumping <replaceable class="parameter">njobs</replaceable>
-        tables simultaneously. This option reduces the time of the dump but it also
+        tables simultaneously. This option reduces the duration of the dump but it also
         increases the load on the database server. You can only use this option with the
         directory output format because this is the only output format where multiple processes
         can write their data at the same time.
diff --git a/doc/src/sgml/ref/reindexdb.sgml b/doc/src/sgml/ref/reindexdb.sgml
index f6c3d9538b..4388d1329c 100644
--- a/doc/src/sgml/ref/reindexdb.sgml
+++ b/doc/src/sgml/ref/reindexdb.sgml
@@ -173,8 +173,8 @@ PostgreSQL documentation
        <para>
         Execute the reindex commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option reduces the processing time
+        but it also increases the load on the database server.
        </para>
        <para>
         <application>reindexdb</application> will open
diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml
index fd1dc140ab..93a3eed813 100644
--- a/doc/src/sgml/ref/vacuumdb.sgml
+++ b/doc/src/sgml/ref/vacuumdb.sgml
@@ -155,8 +155,8 @@ PostgreSQL documentation
        <para>
         Execute the vacuum or analyze commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option reduces the processing
+        duration but it also increases the load on the database server.
        </para>
        <para>
         <application>vacuumdb</application> will open
-- 
2.17.0

v4-0005-docs-Add-wait-events-for-recovery-conflicts.patchtext/x-diff; charset=us-asciiDownload
From 9f0005c1b8652d3ef698fff0679998afdf3388d9 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 5 Apr 2020 22:55:46 -0500
Subject: [PATCH v4 05/12] docs: Add wait events for recovery conflicts.

commit 18808f8c893d4f425f2d21b2a1ffc8e51f1bd0ba
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index d5d9da659d..52264853eb 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1484,11 +1484,11 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
         </row>
         <row>
          <entry><literal>RecoveryConflictSnapshot</literal></entry>
-         <entry>Waiting for recovery conflict resolution on a vacuum cleanup.</entry>
+         <entry>Waiting for recovery conflict resolution during vacuum cleanup.</entry>
         </row>
         <row>
          <entry><literal>RecoveryConflictTablespace</literal></entry>
-         <entry>Waiting for recovery conflict resolution on dropping tablespace.</entry>
+         <entry>Waiting for recovery conflict resolution while dropping tablespace.</entry>
         </row>
         <row>
          <entry><literal>RecoveryPause</literal></entry>
-- 
2.17.0

v4-0006-doc-Allow-users-to-limit-storage-reserved-by-repl.patchtext/x-diff; charset=us-asciiDownload
From e493ff7608c5bc5c8d1d27b2afe9fbef7134449f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 7 Apr 2020 19:56:56 -0500
Subject: [PATCH v4 06/12] doc: Allow users to limit storage reserved by
 replication slots

commit c6550776394e25c1620bc8258427c8f1d448080d
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
---
 doc/src/sgml/config.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index a14df06292..36f47acddd 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3790,9 +3790,9 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         slots</link> are allowed to retain in the <filename>pg_wal</filename>
         directory at checkpoint time.
         If <varname>max_slot_wal_keep_size</varname> is -1 (the default),
-        replication slots retain unlimited amount of WAL files.  If
-        restart_lsn of a replication slot gets behind more than that megabytes
-        from the current LSN, the standby using the slot may no longer be able
+        replication slots retain unlimited amount of WAL files.  Otherwise, if
+        restart_lsn of a replication slot falls behind the current LSN by more
+        than the specified size, the standby using the slot may no longer be able
         to continue replication due to removal of required WAL files. You
         can see the WAL availability of replication slots
         in <link linkend="view-pg-replication-slots">pg_replication_slots</link>.
-- 
2.17.0

v4-0007-docs-s-evade-avoid.patchtext/x-diff; charset=us-asciiDownload
From b770edf7043dcd11c6186a986b696332818c061a Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 6 Apr 2020 17:16:07 -0500
Subject: [PATCH v4 07/12] docs: s/evade/avoid/

---
 src/backend/access/gin/README         | 2 +-
 src/backend/utils/adt/jsonpath_exec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/access/gin/README b/src/backend/access/gin/README
index 125a82219b..41d4e1e8a0 100644
--- a/src/backend/access/gin/README
+++ b/src/backend/access/gin/README
@@ -413,7 +413,7 @@ leftmost leaf of the tree.
 Deletion algorithm keeps exclusive locks on left siblings of pages comprising
 currently investigated path.  Thus, if current page is to be removed, all
 required pages to remove both downlink and rightlink are already locked.  That
-evades potential right to left page locking order, which could deadlock with
+avoids potential right to left page locking order, which could deadlock with
 concurrent stepping right.
 
 A search concurrent to page deletion might already have read a pointer to the
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index bc063061cf..0faa66551f 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -35,7 +35,7 @@
  * executeItemOptUnwrapTarget() function have 'unwrap' argument, which indicates
  * whether unwrapping of array is needed.  When unwrap == true, each of array
  * members is passed to executeItemOptUnwrapTarget() again but with unwrap == false
- * in order to evade subsequent array unwrapping.
+ * in order to avoid subsequent array unwrapping.
  *
  * All boolean expressions (predicates) are evaluated by executeBoolItem()
  * function, which returns tri-state JsonPathBool.  When error is occurred
-- 
2.17.0

v4-0008-doc-Add-logical-replication-support-to-replicate-.patchtext/x-diff; charset=us-asciiDownload
From 0481b8b9559b6b558f4110409bb40d98785da18e Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 10:05:21 -0500
Subject: [PATCH v4 08/12] doc: Add logical replication support to replicate
 into partitioned tables

commit f1ac27bfda6ce8a399d8001843e9aefff5814f9b
Author: Peter Eisentraut <peter@eisentraut.org>
---
 doc/src/sgml/logical-replication.sgml      | 2 +-
 src/backend/replication/logical/relation.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index eba331a72b..faf6d56bed 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -404,7 +404,7 @@
     <para>
      Replication is only supported by tables, including partitioned tables.
      Attempts to replicate other types of relations such as views, materialized
-     views, or foreign tables, will result in an error.
+     views, or foreign tables will result in an error.
     </para>
    </listitem>
 
diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c
index fec39354c0..351b0950c0 100644
--- a/src/backend/replication/logical/relation.c
+++ b/src/backend/replication/logical/relation.c
@@ -631,7 +631,7 @@ logicalrep_partition_open(LogicalRepRelMapEntry *root,
 	/*
 	 * If the partition's attributes don't match the root relation's, we'll
 	 * need to make a new attrmap which maps partition attribute numbers to
-	 * remoterel's, instead the original which maps root relation's attribute
+	 * remoterel's, instead of the original which maps root relation's attribute
 	 * numbers to remoterel's.
 	 *
 	 * Note that 'map' which comes from the tuple routing data structure
-- 
2.17.0

v4-0009-doc-2014-pg_basebackup-Add-support-for-relocating.patchtext/x-diff; charset=us-asciiDownload
From 9475b35c08be302ac7ade5b4eb4505d69e1f0449 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 26 Feb 2020 12:33:32 -0600
Subject: [PATCH v4 09/12] doc(2014): pg_basebackup: Add support for relocating
 tablespaces

commit fb05f3ce83d225dd0f39f8860ce04082753e9e98
Author: Peter Eisentraut <peter_e@gmx.net>
---
 doc/src/sgml/ref/pg_basebackup.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index 01ce44ee22..55904f572e 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -808,7 +808,7 @@ PostgreSQL documentation
   </para>
 
   <para>
-   Tablespaces will in plain format by default be backed up to the same path
+   In plain format, tablespaces will by default be backed up to the same path
    they have on the server, unless the
    option <literal>--tablespace-mapping</literal> is used.  Without
    this option, running a plain format base backup on the same host as the
-- 
2.17.0

v4-0010-is-vs-are-plural.patchtext/x-diff; charset=us-asciiDownload
From e43993a373c2002b0fb6bdc35c88d25cda7fd40d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 4 Apr 2019 18:57:48 -0500
Subject: [PATCH v4 10/12] is vs are plural

Should backpatch to v12
---
 doc/src/sgml/auto-explain.sgml    | 6 +++---
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 doc/src/sgml/sources.sgml         | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/src/sgml/auto-explain.sgml b/doc/src/sgml/auto-explain.sgml
index 192d6574c3..de2be61bff 100644
--- a/doc/src/sgml/auto-explain.sgml
+++ b/doc/src/sgml/auto-explain.sgml
@@ -200,9 +200,9 @@ LOAD 'auto_explain';
     <listitem>
      <para>
       <varname>auto_explain.log_settings</varname> controls whether information
-      about modified configuration options is printed when execution plan is logged.
-      Only options affecting query planning with value different from the built-in
-      default value are included in the output.  This parameter is off by default.
+      about modified configuration options is printed when an execution plan is logged.
+      Only those options which affect query planning and whose value differs from their
+      built-in default are included in the output.  This parameter is off by default.
       Only superusers can change this setting.
      </para>
     </listitem>
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index 6563bd5ab2..52211612c6 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -891,7 +891,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       from the parent table will be created in the partition, if they don't
       already exist.
       If any of the <literal>CHECK</literal> constraints of the table being
-      attached is marked <literal>NO INHERIT</literal>, the command will fail;
+      attached are marked <literal>NO INHERIT</literal>, the command will fail;
       such constraints must be recreated without the
       <literal>NO INHERIT</literal> clause.
      </para>
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 283c3e0357..12704c6fdf 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -466,8 +466,8 @@ Hint:       the addendum
     enough for error messages.  Detail and hint messages can be relegated to a
     verbose mode, or perhaps a pop-up error-details window.  Also, details and
     hints would normally be suppressed from the server log to save
-    space. Reference to implementation details is best avoided since users
-    aren't expected to know the details.
+    space. References to implementation details are best avoided since users
+    aren't expected to know them.
    </para>
 
   </simplesect>
-- 
2.17.0

v4-0011-doc-Rename-the-recovery-related-wait-events.patchtext/x-diff; charset=us-asciiDownload
From 87d9c5dc362ac68fa85769bff174442a01f75824 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 09:02:15 -0500
Subject: [PATCH v4 11/12] doc: Rename the recovery-related wait events.

commit 1d253bae57fcb3e75cdd9cdb2592c5b09cf7e7b7
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 52264853eb..3cabc24721 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1526,9 +1526,9 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
         <row>
          <entry><literal>RecoveryRetrieveRetryInterval</literal></entry>
          <entry>
-          Waiting when WAL data is not available from any kind of sources
-          (<filename>pg_wal</filename>, archive or stream) before trying
-          again to retrieve WAL data, at recovery.
+          Waiting in recovery when WAL data is not available from any source
+          (<filename>pg_wal</filename>, archive or stream) before re-trying
+          to retrieve WAL data.
          </entry>
         </row>
         <row>
-- 
2.17.0

v4-0012-comment-typos.patchtext/x-diff; charset=us-asciiDownload
From 64676ea3368619e84f8e14d20e1599f9f8bd3573 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 17 Feb 2020 12:33:42 -0600
Subject: [PATCH v4 12/12] comment typos

---
 contrib/pgcrypto/imath.c               | 4 ++--
 src/backend/access/transam/multixact.c | 2 +-
 src/backend/partitioning/partbounds.c  | 2 +-
 src/include/lib/simplehash.h           | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/pgcrypto/imath.c b/contrib/pgcrypto/imath.c
index da4cdede76..a05a4bf5fd 100644
--- a/contrib/pgcrypto/imath.c
+++ b/contrib/pgcrypto/imath.c
@@ -3232,7 +3232,7 @@ s_embar(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c)
 
    We diverge from Knuth's algorithm in that we do not perform the subtraction
    from the remainder until we have determined that we have the correct
-   quotient digit. This makes our algorithm less efficient that Knuth because
+   quotient digit. This makes our algorithm less efficient than Knuth because
    we might have to perform multiple multiplication and comparison steps before
    the subtraction. The advantage is that it is easy to implement and ensure
    correctness without worrying about underflow from the subtraction.
@@ -3355,7 +3355,7 @@ s_udiv_knuth(mp_int u, mp_int v)
 
 		/*
 		 * Check to see if qhat > b, and decrease qhat if so. Theorem B
-		 * guarantess that qhat is at most 2 larger than the actual value, so
+		 * guarantees that qhat is at most 2 larger than the actual value, so
 		 * it is possible that qhat is greater than the maximum value that
 		 * will fit in a digit
 		 */
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index 70d0e1c215..e2aa5c9ce4 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -2666,7 +2666,7 @@ SetOffsetVacuumLimit(bool is_startup)
  * We use this to determine whether the addition is "wrapping around" the
  * boundary point, hence the name.  The reason we don't want to use the regular
  * 2^31-modulo arithmetic here is that we want to be able to use the whole of
- * the 2^32-1 space here, allowing for more multixacts that would fit
+ * the 2^32-1 space here, allowing for more multixacts than would fit
  * otherwise.
  */
 static bool
diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index 4681441dcc..b9c65ff87c 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -1224,7 +1224,7 @@ merge_list_bounds(FmgrInfo *partsupfunc, Oid *partcollation,
 			Assert(inner_index >= 0);
 
 			/*
-			 * Try merging both paritions.  If successful, add the list value
+			 * Try merging both partitions.  If successful, add the list value
 			 * and index of the merged partition below.
 			 */
 			merged_index = merge_matching_partitions(&outer_map, &inner_map,
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index f7af921f5a..88f4c9a53f 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -560,7 +560,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

#8James Coleman
jtc331@gmail.com
In reply to: Justin Pryzby (#7)
Re: doc review for v13

On Sun, Apr 26, 2020 at 12:13 PM Justin Pryzby <pryzby@telsasoft.com> wrote:

On Tue, Apr 14, 2020 at 02:47:54PM +0900, Michael Paquier wrote:

On Sun, Apr 12, 2020 at 04:35:45PM -0500, Justin Pryzby wrote:

Added a few more.
And rebased on top of dbc60c5593f26dc777a3be032bff4fb4eab1ddd1

Thanks for the patch set, I have applied the most obvious parts (more
or less 1/3) to reduce the load. Here is a review of the rest.

Thanks - attached are the remaining undisputed portions..

+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -889,7 +889,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
from the parent table will be created in the partition, if they don't
already exist.
If any of the <literal>CHECK</literal> constraints of the table being
-      attached is marked <literal>NO INHERIT</literal>, the command will fail;
+      attached are marked <literal>NO INHERIT</literal>, the command will fail;
such constraints must be recreated without the
<literal>NO INHERIT</literal> clause.
</para>

It seems to me that both are actually correct here.

I think my text is correct. This would *also* be correct:

| If any <literal>CHECK</literal> constraint on the table being
| attached is marked <literal>NO INHERIT</literal>, the command will fail;

But not the hybrid: "If any OF THE .. is .."

"any of the...are" sounds more natural to my ears, and some searching
yielded some grammar sites that agree (specifically that "any of" is
only used with singular verbs if the construction is uncountable or
negative).

However there are also multiple claims by grammarians that either
singular or plural verbs are acceptable with the "any of"
construction. So that's not all that helpful.

James

#9Tom Lane
tgl@sss.pgh.pa.us
In reply to: James Coleman (#8)
Re: doc review for v13

James Coleman <jtc331@gmail.com> writes:

On Sun, Apr 26, 2020 at 12:13 PM Justin Pryzby <pryzby@telsasoft.com> wrote:

I think my text is correct. This would *also* be correct:
| If any <literal>CHECK</literal> constraint on the table being
| attached is marked <literal>NO INHERIT</literal>, the command will fail;
But not the hybrid: "If any OF THE .. is .."

"any of the...are" sounds more natural to my ears,

Yeah, I think the same. If you want to argue grammar, I'd point
out that the "any" could refer to several of the constraints,
making it correct to use the plural verb. The alternative that
Justin mentions could be written as "If any one constraint is ...",
which is correct in that form; but the plural way seems less stilted.

regards, tom lane

#10Michael Paquier
michael@paquier.xyz
In reply to: Tom Lane (#9)
Re: doc review for v13

On Sun, Apr 26, 2020 at 08:59:05PM -0400, Tom Lane wrote:

James Coleman <jtc331@gmail.com> writes:

On Sun, Apr 26, 2020 at 12:13 PM Justin Pryzby <pryzby@telsasoft.com> wrote:

I think my text is correct. This would *also* be correct:
| If any <literal>CHECK</literal> constraint on the table being
| attached is marked <literal>NO INHERIT</literal>, the command will fail;
But not the hybrid: "If any OF THE .. is .."

"any of the...are" sounds more natural to my ears,

Yeah, I think the same. If you want to argue grammar, I'd point
out that the "any" could refer to several of the constraints,
making it correct to use the plural verb. The alternative that
Justin mentions could be written as "If any one constraint is ...",
which is correct in that form; but the plural way seems less stilted.

Hm, okay. There are still pieces in those patches about which I am
not sure, so I have let that aside for the time being.

Anyway, I have applied patch 12, and reported the typos from imath.c
directly to upstream:
https://github.com/creachadair/imath/issues/45
https://github.com/creachadair/imath/issues/46
--
Michael

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

On Mon, Apr 27, 2020 at 03:03:05PM +0900, Michael Paquier wrote:

Hm, okay. There are still pieces in those patches about which I am
not sure, so I have let that aside for the time being.

Anyway, I have applied patch 12, and reported the typos from imath.c

Thank you.

I will leave this here in case someone else wants to make a pass or vet them.

diff --git a/doc/src/sgml/auto-explain.sgml b/doc/src/sgml/auto-explain.sgml
index 192d6574c3..de2be61bff 100644
--- a/doc/src/sgml/auto-explain.sgml
+++ b/doc/src/sgml/auto-explain.sgml
@@ -200,9 +200,9 @@ LOAD 'auto_explain';
     <listitem>
      <para>
       <varname>auto_explain.log_settings</varname> controls whether information
-      about modified configuration options is printed when execution plan is logged.
-      Only options affecting query planning with value different from the built-in
-      default value are included in the output.  This parameter is off by default.
+      about modified configuration options is printed when an execution plan is logged.
+      Only those options which affect query planning and whose value differs from their
+      built-in default are included in the output.  This parameter is off by default.
       Only superusers can change this setting.
      </para>
     </listitem>
diff --git a/doc/src/sgml/btree.sgml b/doc/src/sgml/btree.sgml
index e9cab4a55d..ff1e49e509 100644
--- a/doc/src/sgml/btree.sgml
+++ b/doc/src/sgml/btree.sgml
@@ -609,7 +609,7 @@ equalimage(<replaceable>opcintype</replaceable> <type>oid</type>) returns bool
   </para>
   <para>
    Deduplication works by periodically merging groups of duplicate
-   tuples together, forming a single posting list tuple for each
+   tuples together, forming a single <firstterm>posting list</firstterm> tuple for each
    group.  The column key value(s) only appear once in this
    representation.  This is followed by a sorted array of
    <acronym>TID</acronym>s that point to rows in the table.  This
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index a14df06292..87e0183a89 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3667,7 +3667,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         servers or streaming base backup clients (i.e., the maximum number of
         simultaneously running WAL sender processes). The default is
         <literal>10</literal>.  The value <literal>0</literal> means
-        replication is disabled.  Abrupt streaming client disconnection might
+        replication is disabled.  Abrupt disconnection of a streaming client might
         leave an orphaned connection slot behind until a timeout is reached,
         so this parameter should be set slightly higher than the maximum
         number of expected clients so disconnected clients can immediately
@@ -3790,9 +3790,9 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         slots</link> are allowed to retain in the <filename>pg_wal</filename>
         directory at checkpoint time.
         If <varname>max_slot_wal_keep_size</varname> is -1 (the default),
-        replication slots retain unlimited amount of WAL files.  If
-        restart_lsn of a replication slot gets behind more than that megabytes
-        from the current LSN, the standby using the slot may no longer be able
+        replication slots retain unlimited amount of WAL files.  Otherwise, if
+        restart_lsn of a replication slot falls behind the current LSN by more
+        than the specified size, the standby using the slot may no longer be able
         to continue replication due to removal of required WAL files. You
         can see the WAL availability of replication slots
         in <link linkend="view-pg-replication-slots">pg_replication_slots</link>.
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 2a478c4f73..9ec0d4c783 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3959,7 +3959,7 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02
      Before running the <command>ATTACH PARTITION</command> command, it is
      recommended to create a <literal>CHECK</literal> constraint on the table to
      be attached matching the desired partition constraint. That way,
-     the system will be able to skip the scan to validate the implicit
+     the system will be able to skip the scan which is otherwise needed to validate the implicit
      partition constraint. Without the <literal>CHECK</literal> constraint,
      the table will be scanned to validate the partition constraint while
      holding an <literal>ACCESS EXCLUSIVE</literal> lock on that partition
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 75d2224a61..b9c789eb6f 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -925,11 +925,11 @@ postgresql:///mydb?host=localhost&amp;port=5433
    </para>
    <para>
-    Connection <acronym>URI</acronym> needs to be encoded with 
+    A connection <acronym>URI</acronym> needs to be encoded with 
     <ulink url="https://tools.ietf.org/html/rfc3986#section-2.1">Percent-encoding</ulink> 
-    if it includes symbols with special meaning in any of its parts. 
-    Here is an example where equal sign (<literal>=</literal>) is replaced
-    with <literal>%3D</literal> and whitespace character with
+    if it includes symbols with special meanings in any of its parts. 
+    Here is an example where an equal sign (<literal>=</literal>) is replaced
+    with <literal>%3D</literal> and a whitespace character with
     <literal>%20</literal>:
 <programlisting>
 postgresql://user@localhost:5433/mydb?options=-c%20synchronous_commit%3Doff
@@ -1223,7 +1223,7 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
       <term><literal>connect_timeout</literal></term>
       <listitem>
       <para>
-       Maximum wait for connection, in seconds (write as a decimal integer,
+       Maximum time to wait while connecting, in seconds (write as a decimal integer,
        e.g. <literal>10</literal>).  Zero, negative, or not specified means
        wait indefinitely.  The minimum allowed timeout is 2 seconds, therefore
        a value of <literal>1</literal> is interpreted as <literal>2</literal>.
diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index eba331a72b..faf6d56bed 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -404,7 +404,7 @@
     <para>
      Replication is only supported by tables, including partitioned tables.
      Attempts to replicate other types of relations such as views, materialized
-     views, or foreign tables, will result in an error.
+     views, or foreign tables will result in an error.
     </para>
    </listitem>
diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index bad3bfe620..e08ae9e2af 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -223,7 +223,7 @@ $ pg_recvlogical -d postgres --slot=test --drop-slot
      A logical slot will emit each change just once in normal operation.
      The current position of each slot is persisted only at checkpoint, so in
      the case of a crash the slot may return to an earlier LSN, which will
-     then cause recent changes to be resent when the server restarts.
+     then cause recent changes to be re-sent when the server restarts.
      Logical decoding clients are responsible for avoiding ill effects from
      handling the same message more than once.  Clients may wish to record
      the last LSN they saw when decoding and skip over any repeated data or
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 6562cc400b..3cabc24721 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1484,11 +1484,11 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
         </row>
         <row>
          <entry><literal>RecoveryConflictSnapshot</literal></entry>
-         <entry>Waiting for recovery conflict resolution on a vacuum cleanup.</entry>
+         <entry>Waiting for recovery conflict resolution during vacuum cleanup.</entry>
         </row>
         <row>
          <entry><literal>RecoveryConflictTablespace</literal></entry>
-         <entry>Waiting for recovery conflict resolution on dropping tablespace.</entry>
+         <entry>Waiting for recovery conflict resolution while dropping tablespace.</entry>
         </row>
         <row>
          <entry><literal>RecoveryPause</literal></entry>
@@ -1526,9 +1526,9 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
         <row>
          <entry><literal>RecoveryRetrieveRetryInterval</literal></entry>
          <entry>
-          Waiting when WAL data is not available from any kind of sources
-          (<filename>pg_wal</filename>, archive or stream) before trying
-          again to retrieve WAL data, at recovery.
+          Waiting in recovery when WAL data is not available from any source
+          (<filename>pg_wal</filename>, archive or stream) before re-trying
+          to retrieve WAL data.
          </entry>
         </row>
         <row>
@@ -4577,8 +4577,8 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
       <entry><literal>waiting for checkpoint to finish</literal></entry>
       <entry>
        The WAL sender process is currently performing
-       <function>pg_start_backup</function> to set up for
-       taking a base backup, and waiting for backup start
+       <function>pg_start_backup</function> to prepare to
+       take a base backup, and waiting for the start-of-backup
        checkpoint to finish.
       </entry>
      </row>
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 20d1fe0ad8..06919bd87c 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2586,7 +2586,7 @@ The commands accepted in replication mode are:
           and sent along with the backup.  The manifest is a list of every
           file present in the backup with the exception of any WAL files that
           may be included. It also stores the size, last modification time, and
-          an optional checksum for each file.
+          optionally a checksum for each file.
           A value of <literal>force-encode</literal> forces all filenames
           to be hex-encoded; otherwise, this type of encoding is performed only
           for files whose names are non-UTF8 octet sequences.
@@ -2602,7 +2602,7 @@ The commands accepted in replication mode are:
         <term><literal>MANIFEST_CHECKSUMS</literal> <replaceable>checksum_algorithm</replaceable></term>
         <listitem>
          <para>
-          Specifies the algorithm that should be applied to each file included
+          Specifies the checksum algorithm that should be applied to each file included
           in the backup manifest. Currently, the available
           algorithms are <literal>NONE</literal>, <literal>CRC32C</literal>,
           <literal>SHA224</literal>, <literal>SHA256</literal>,
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index 6563bd5ab2..39e9f9a7c7 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -671,7 +671,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       When applied to a partitioned table, nothing is moved, but any
       partitions created afterwards with
       <command>CREATE TABLE PARTITION OF</command> will use that tablespace,
-      unless the <literal>TABLESPACE</literal> clause is used to override it.
+      unless overridden by its <literal>TABLESPACE</literal> clause.
      </para>
      <para>
@@ -891,7 +891,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       from the parent table will be created in the partition, if they don't
       already exist.
       If any of the <literal>CHECK</literal> constraints of the table being
-      attached is marked <literal>NO INHERIT</literal>, the command will fail;
+      attached are marked <literal>NO INHERIT</literal>, the command will fail;
       such constraints must be recreated without the
       <literal>NO INHERIT</literal> clause.
      </para>
diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml
index 1a90c244fb..c18618d5c8 100644
--- a/doc/src/sgml/ref/create_subscription.sgml
+++ b/doc/src/sgml/ref/create_subscription.sgml
@@ -159,7 +159,7 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
          <para>
           It is safe to use <literal>off</literal> for logical replication:
           If the subscriber loses transactions because of missing
-          synchronization, the data will be resent from the publisher.
+          synchronization, the data will be re-sent from the publisher.
          </para>
          <para>
diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index 01ce44ee22..b742470f13 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -604,7 +604,7 @@ PostgreSQL documentation
         not contain any checksums. Otherwise, it will contain a checksum
         of each file in the backup using the specified algorithm. In addition,
         the manifest will always contain a <literal>SHA256</literal>
-        checksum of its own contents. The <literal>SHA</literal> algorithms
+        checksum of its own content. The <literal>SHA</literal> algorithms
         are significantly more CPU-intensive than <literal>CRC32C</literal>,
         so selecting one of them may increase the time required to complete
         the backup.
@@ -614,7 +614,7 @@ PostgreSQL documentation
         of each file for users who wish to verify that the backup has not been
         tampered with, while the CRC32C algorithm provides a checksum which is
         much faster to calculate and good at catching errors due to accidental
-        changes but is not resistant to targeted modifications.  Note that, to
+        changes but is not resistant to malicious modifications.  Note that, to
         be useful against an adversary who has access to the backup, the backup
         manifest would need to be stored securely elsewhere or otherwise
         verified not to have been modified since the backup was taken.
@@ -808,7 +808,7 @@ PostgreSQL documentation
   </para>
   <para>
-   Tablespaces will in plain format by default be backed up to the same path
+   In plain format, tablespaces will by default be backed up to the same path
    they have on the server, unless the
    option <literal>--tablespace-mapping</literal> is used.  Without
    this option, running a plain format base backup on the same host as the
diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index a9bc397165..d58cd05f46 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -323,7 +323,7 @@ PostgreSQL documentation
       <listitem>
        <para>
         Run the dump in parallel by dumping <replaceable class="parameter">njobs</replaceable>
-        tables simultaneously. This option reduces the time of the dump but it also
+        tables simultaneously. This option reduces the duration of the dump but it also
         increases the load on the database server. You can only use this option with the
         directory output format because this is the only output format where multiple processes
         can write their data at the same time.
diff --git a/doc/src/sgml/ref/pg_rewind.sgml b/doc/src/sgml/ref/pg_rewind.sgml
index 07c49e4719..acdefe58b8 100644
--- a/doc/src/sgml/ref/pg_rewind.sgml
+++ b/doc/src/sgml/ref/pg_rewind.sgml
@@ -215,7 +215,7 @@ PostgreSQL documentation
         <command>pg_rewind</command> to return without waiting, which is
         faster, but means that a subsequent operating system crash can leave
         the synchronized data directory corrupt.  Generally, this option is
-        useful for testing but should not be used when creating a production
+        useful for testing but should not be used on a production
         installation.
        </para>
       </listitem>
@@ -309,7 +309,7 @@ GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, b
   <para>
    When executing <application>pg_rewind</application> using an online
    cluster as source which has been recently promoted, it is necessary
-   to execute a <command>CHECKPOINT</command> after promotion so as its
+   to execute a <command>CHECKPOINT</command> after promotion such that its
    control file reflects up-to-date timeline information, which is used by
    <application>pg_rewind</application> to check if the target cluster
    can be rewound using the designated source cluster.
diff --git a/doc/src/sgml/ref/pg_verifybackup.sgml b/doc/src/sgml/ref/pg_verifybackup.sgml
index 4f9759414f..9618275364 100644
--- a/doc/src/sgml/ref/pg_verifybackup.sgml
+++ b/doc/src/sgml/ref/pg_verifybackup.sgml
@@ -46,7 +46,7 @@ PostgreSQL documentation
    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
-   expected and that they appear to contain the correct data. However,
+   expected and that they contain the correct data. However,
    <application>pg_verifybackup</application> can detect many problems
    that commonly occur due to storage problems or user error.
   </para>
@@ -84,7 +84,7 @@ PostgreSQL documentation
    for any files for which the computed checksum does not match the
    checksum stored in the manifest. This step is not performed for any files
    which produced errors in the previous step, since they are already known
-   to have problems. Also, files which were ignored in the previous step are
+   to have problems. Files which were ignored in the previous step are
    also ignored in this step.
   </para>

@@ -123,7 +123,7 @@ PostgreSQL documentation
<title>Options</title>

    <para>
-    The following command-line options control the behavior.
+    The following command-line options control the behavior of this program.
     <variablelist>
      <varlistentry>
diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml
index c54a7c420d..bde5eca164 100644
--- a/doc/src/sgml/ref/reindex.sgml
+++ b/doc/src/sgml/ref/reindex.sgml
@@ -249,7 +249,7 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
   <para>
    Reindexing a single index or table requires being the owner of that
    index or table.  Reindexing a schema or database requires being the
-   owner of that schema or database.  Note that is therefore sometimes
+   owner of that schema or database.  Note specifically that it's
    possible for non-superusers to rebuild indexes of tables owned by
    other users.  However, as a special exception, when
    <command>REINDEX DATABASE</command>, <command>REINDEX SCHEMA</command>
diff --git a/doc/src/sgml/ref/reindexdb.sgml b/doc/src/sgml/ref/reindexdb.sgml
index f6c3d9538b..4388d1329c 100644
--- a/doc/src/sgml/ref/reindexdb.sgml
+++ b/doc/src/sgml/ref/reindexdb.sgml
@@ -173,8 +173,8 @@ PostgreSQL documentation
        <para>
         Execute the reindex commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option reduces the processing time
+        but it also increases the load on the database server.
        </para>
        <para>
         <application>reindexdb</application> will open
diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml
index fd1dc140ab..93a3eed813 100644
--- a/doc/src/sgml/ref/vacuumdb.sgml
+++ b/doc/src/sgml/ref/vacuumdb.sgml
@@ -155,8 +155,8 @@ PostgreSQL documentation
        <para>
         Execute the vacuum or analyze commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option reduces the processing
+        duration but it also increases the load on the database server.
        </para>
        <para>
         <application>vacuumdb</application> will open
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index a34d31d297..3f90c15f3e 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -2643,7 +2643,7 @@ openssl x509 -req -in server.csr -text -days 365 \
    <para>
     The <productname>PostgreSQL</productname> server will listen for both
     normal and <acronym>GSSAPI</acronym>-encrypted connections on the same TCP
-    port, and will negotiate with any connecting client on whether to
+    port, and will negotiate with any connecting client whether to
     use <acronym>GSSAPI</acronym> for encryption (and for authentication).  By
     default, this decision is up to the client (which means it can be
     downgraded by an attacker); see <xref linkend="auth-pg-hba-conf"/> about
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 283c3e0357..5a8dbcb4d3 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -373,7 +373,7 @@ ereport(ERROR,
      specify suppression of the <literal>CONTEXT:</literal> portion of a message in
      the postmaster log.  This should only be used for verbose debugging
      messages where the repeated inclusion of context would bloat the log
-     volume too much.
+     too much.
     </para>
    </listitem>
   </itemizedlist>
@@ -466,8 +466,8 @@ Hint:       the addendum
     enough for error messages.  Detail and hint messages can be relegated to a
     verbose mode, or perhaps a pop-up error-details window.  Also, details and
     hints would normally be suppressed from the server log to save
-    space. Reference to implementation details is best avoided since users
-    aren't expected to know the details.
+    space. References to implementation details are best avoided since users
+    aren't expected to know them.
    </para>

</simplesect>
@@ -518,7 +518,7 @@ Hint: the addendum
<title>Use of Quotes</title>

    <para>
-    Use quotes always to delimit file names, user-supplied identifiers, and
+    Always use quotes to delimit file names, user-supplied identifiers, and
     other variables that might contain words.  Do not use them to mark up
     variables that will not contain words (for example, operator names).
    </para>
diff --git a/src/backend/access/gin/README b/src/backend/access/gin/README
index 125a82219b..41d4e1e8a0 100644
--- a/src/backend/access/gin/README
+++ b/src/backend/access/gin/README
@@ -413,7 +413,7 @@ leftmost leaf of the tree.
 Deletion algorithm keeps exclusive locks on left siblings of pages comprising
 currently investigated path.  Thus, if current page is to be removed, all
 required pages to remove both downlink and rightlink are already locked.  That
-evades potential right to left page locking order, which could deadlock with
+avoids potential right to left page locking order, which could deadlock with
 concurrent stepping right.
 A search concurrent to page deletion might already have read a pointer to the
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 7ae6131676..7cdf4b84e2 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -2869,7 +2869,7 @@ show_incremental_sort_group_info(IncrementalSortGroupInfo *groupInfo,
 }
 /*
- * If it's EXPLAIN ANALYZE, show tuplesort stats for a incremental sort node
+ * If it's EXPLAIN ANALYZE, show tuplesort stats for an incremental sort node
  */
 static void
 show_incremental_sort_info(IncrementalSortState *incrsortstate,
@@ -2917,7 +2917,7 @@ show_incremental_sort_info(IncrementalSortState *incrsortstate,
 			&incrsortstate->shared_info->sinfo[n];
 			/*
-			 * If a worker hasn't process any sort groups at all, then exclude
+			 * If a worker hasn't processed any sort groups at all, then exclude
 			 * it from output since it either didn't launch or didn't
 			 * contribute anything meaningful.
 			 */
diff --git a/src/backend/executor/nodeIncrementalSort.c b/src/backend/executor/nodeIncrementalSort.c
index 39ba11cdf7..da99453c91 100644
--- a/src/backend/executor/nodeIncrementalSort.c
+++ b/src/backend/executor/nodeIncrementalSort.c
@@ -987,7 +987,7 @@ ExecInitIncrementalSort(IncrementalSort *node, EState *estate, int eflags)
 	/*
 	 * Incremental sort can't be used with either EXEC_FLAG_REWIND,
-	 * EXEC_FLAG_BACKWARD or EXEC_FLAG_MARK, because we only one of many sort
+	 * EXEC_FLAG_BACKWARD or EXEC_FLAG_MARK, because we only ???? one of many sort
 	 * batches in the current sort state.
 	 */
 	Assert((eflags & (EXEC_FLAG_BACKWARD |
@@ -1153,8 +1153,10 @@ ExecReScanIncrementalSort(IncrementalSortState *node)
 	/*
 	 * If we've set up either of the sort states yet, we need to reset them.
 	 * We could end them and null out the pointers, but there's no reason to
-	 * repay the setup cost, and because guard setting up pivot comparator
-	 * state similarly, doing so might actually cause a leak.
+	 * repay the setup cost, and because ExecIncrementalSort guards
+	 * presorted column functions by checking to see if the full sort state
+	 * has been initialized yet, setting the sort states to null here might
+	 * actually cause a leak.
 	 */
 	if (node->fullsort_state != NULL)
 	{
diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c
index fec39354c0..351b0950c0 100644
--- a/src/backend/replication/logical/relation.c
+++ b/src/backend/replication/logical/relation.c
@@ -631,7 +631,7 @@ logicalrep_partition_open(LogicalRepRelMapEntry *root,
 	/*
 	 * If the partition's attributes don't match the root relation's, we'll
 	 * need to make a new attrmap which maps partition attribute numbers to
-	 * remoterel's, instead the original which maps root relation's attribute
+	 * remoterel's, instead of the original which maps root relation's attribute
 	 * numbers to remoterel's.
 	 *
 	 * Note that 'map' which comes from the tuple routing data structure
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index 5aa19d3f78..22fe566f48 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -1373,7 +1373,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
 			else
 				LWLockRelease(ProcArrayLock);
-			/* prevent signal from being resent more than once */
+			/* prevent signal from being re-sent more than once */
 			allow_autovacuum_cancel = false;
 		}
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index bc063061cf..0faa66551f 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -35,7 +35,7 @@
  * executeItemOptUnwrapTarget() function have 'unwrap' argument, which indicates
  * whether unwrapping of array is needed.  When unwrap == true, each of array
  * members is passed to executeItemOptUnwrapTarget() again but with unwrap == false
- * in order to evade subsequent array unwrapping.
+ * in order to avoid subsequent array unwrapping.
  *
  * All boolean expressions (predicates) are evaluated by executeBoolItem()
  * function, which returns tri-state JsonPathBool.  When error is occurred
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index de38c6c7e0..c25a22f79b 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -1428,11 +1428,11 @@ tuplesort_updatemax(Tuplesortstate *state)
 	}
 	/*
-	 * Sort evicts data to the disk when it didn't manage to fit those data to
-	 * the main memory.  This is why we assume space used on the disk to be
+	 * Sort evicts data to the disk when it didn't fit data in
+	 * main memory.  This is why we assume space used on the disk to be
 	 * more important for tracking resource usage than space used in memory.
-	 * Note that amount of space occupied by some tuple set on the disk might
-	 * be less than amount of space occupied by the same tuple set in the
+	 * Note that the amount of space occupied by some tupleset on the disk might
+	 * be less than amount of space occupied by the same tupleset in
 	 * memory due to more compact representation.
 	 */
 	if ((isSpaceDisk && !state->isMaxSpaceDisk) ||
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index f7af921f5a..88f4c9a53f 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -560,7 +560,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++;

--
Justin

#12Justin Pryzby
pryzby@telsasoft.com
In reply to: Michael Paquier (#10)
5 attachment(s)
Re: doc review for v13

Some new bits,
And some old ones.

--
Justin

Attachments:

v5-0001-Fix-comments-for-WITH-OIDs-removed-at-578b22971.patchtext/x-diff; charset=us-asciiDownload
From b74bef6f9d36a2fac71045ab707ed4be65730ba7 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Wed, 29 Apr 2020 13:13:29 -0500
Subject: [PATCH v5 1/5] Fix comments for WITH OIDs, removed at 578b22971

Previously mentioned here:
https://www.postgresql.org/message-id/20200429194622.GA25643@telsasoft.com
---
 src/backend/access/common/tupdesc.c | 4 +---
 src/backend/access/transam/varsup.c | 3 +--
 src/backend/commands/tablecmds.c    | 5 ++---
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c
index 1e743d7d86..ce84e22cbd 100644
--- a/src/backend/access/common/tupdesc.c
+++ b/src/backend/access/common/tupdesc.c
@@ -786,9 +786,7 @@ TupleDescInitEntryCollation(TupleDesc desc,
  *
  * Given a relation schema (list of ColumnDef nodes), build a TupleDesc.
  *
- * Note: the default assumption is no OIDs; caller may modify the returned
- * TupleDesc if it wants OIDs.  Also, tdtypeid will need to be filled in
- * later on.
+ * tdtypeid will need to be filled in later on.
  */
 TupleDesc
 BuildDescForRelation(List *schema)
diff --git a/src/backend/access/transam/varsup.c b/src/backend/access/transam/varsup.c
index e14b53bf9e..8328b8050a 100644
--- a/src/backend/access/transam/varsup.c
+++ b/src/backend/access/transam/varsup.c
@@ -527,8 +527,7 @@ GetNewObjectId(void)
 	 * The first time through this routine after normal postmaster start, the
 	 * counter will be forced up to FirstNormalObjectId.  This mechanism
 	 * leaves the OIDs between FirstBootstrapObjectId and FirstNormalObjectId
-	 * available for automatic assignment during initdb, while ensuring they
-	 * will never conflict with user-assigned OIDs.
+	 * available for automatic assignment during initdb.
 	 */
 	if (ShmemVariableCache->nextOid < ((Oid) FirstNormalObjectId))
 	{
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 2ab02e01a0..35945bce73 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -4829,7 +4829,7 @@ ATRewriteTables(AlterTableStmt *parsetree, List **wqueue, LOCKMODE lockmode,
 			continue;
 
 		/*
-		 * If we change column data types or add/remove OIDs, the operation
+		 * If we change column data types, the operation
 		 * has to be propagated to tables that use this table's rowtype as a
 		 * column type.  tab->newvals will also be non-NULL in the case where
 		 * we're adding a column with a default.  We choose to forbid that
@@ -4853,8 +4853,7 @@ ATRewriteTables(AlterTableStmt *parsetree, List **wqueue, LOCKMODE lockmode,
 
 		/*
 		 * We only need to rewrite the table if at least one column needs to
-		 * be recomputed, we are adding/removing the OID column, or we are
-		 * changing its persistence.
+		 * be recomputed, or we are changing its persistence.
 		 *
 		 * There are two reasons for requiring a rewrite when changing
 		 * persistence: on one hand, we need to ensure that the buffers
-- 
2.17.0

v5-0002-Remove-mention-of-double-timestamps.patchtext/x-diff; charset=us-asciiDownload
From eb85fabed31d7c3a8fa1396ddfd2ea733c5c8baf Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 10 May 2020 17:30:14 -0500
Subject: [PATCH v5 2/5] Remove mention of double timestamps..

..which were removed in v10.

This was previously discussed here:
https://www.postgresql.org/message-id/20191230074721.GM12890%40telsasoft.com
---
 src/backend/utils/adt/selfuncs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 0f02f32ffd..be08eb4814 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -4018,8 +4018,8 @@ estimate_multivariate_ndistinct(PlannerInfo *root, RelOptInfo *rel,
  * to be treated separately.
  *
  * The several datatypes representing absolute times are all converted
- * to Timestamp, which is actually a double, and then we just use that
- * double value.  Note this will give correct results even for the "special"
+ * to Timestamp, which is actually an int64, and then we promote that to
+ * a double.  Note this will give correct results even for the "special"
  * values of Timestamp, since those are chosen to compare correctly;
  * see timestamp_cmp.
  *
-- 
2.17.0

v5-0003-possessive-its-and-more.patchtext/x-diff; charset=us-asciiDownload
From c0501535b1ec3709abb8334ddd29f2603bece5ca Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 3 May 2020 19:57:32 -0500
Subject: [PATCH v5 3/5] possessive: its (and more)

---
 src/backend/replication/logical/origin.c | 2 +-
 src/backend/utils/mmgr/README            | 2 +-
 src/bin/pg_dump/pg_backup_archiver.c     | 6 +++---
 src/bin/pg_dump/pg_backup_custom.c       | 8 +++-----
 4 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c
index 1ca4479605..dec9e95119 100644
--- a/src/backend/replication/logical/origin.c
+++ b/src/backend/replication/logical/origin.c
@@ -427,7 +427,7 @@ restart:
 
 
 /*
- * Lookup replication origin via it's oid and return the name.
+ * Lookup replication origin via its oid and return the name.
  *
  * The external name is palloc'd in the calling context.
  *
diff --git a/src/backend/utils/mmgr/README b/src/backend/utils/mmgr/README
index e892779cdd..221b4bd343 100644
--- a/src/backend/utils/mmgr/README
+++ b/src/backend/utils/mmgr/README
@@ -462,7 +462,7 @@ Memory Accounting
 -----------------
 
 One of the basic memory context operations is determining the amount of
-memory used in the context (and it's children). We have multiple places
+memory used in the context (and its children). We have multiple places
 that implement their own ad hoc memory accounting, and this is meant to
 provide a unified approach. Ad hoc accounting solutions work for places
 with tight control over the allocations or when it's easy to determine
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 8f0b32ca17..4c91b9e1bc 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -209,14 +209,14 @@ dumpOptionsFromRestoreOptions(RestoreOptions *ropt)
 /*
  *	Wrapper functions.
  *
- *	The objective it to make writing new formats and dumpers as simple
+ *	The objective is to make writing new formats and dumpers as simple
  *	as possible, if necessary at the expense of extra function calls etc.
  *
  */
 
 /*
  * The dump worker setup needs lots of knowledge of the internals of pg_dump,
- * so It's defined in pg_dump.c and passed into OpenArchive. The restore worker
+ * so it's defined in pg_dump.c and passed into OpenArchive. The restore worker
  * setup doesn't need to know anything much, so it's defined here.
  */
 static void
@@ -1450,7 +1450,7 @@ SortTocFromFile(Archive *AHX)
 }
 
 /**********************
- * 'Convenience functions that look like standard IO functions
+ * Convenience functions that look like standard IO functions
  * for writing data when in dump mode.
  **********************/
 
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index 369dcea429..31a03ea3ee 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -262,7 +262,6 @@ _ReadExtraToc(ArchiveHandle *AH, TocEntry *te)
  * that includes useful information about the TOC entry.
  *
  * Optional.
- *
  */
 static void
 _PrintExtraToc(ArchiveHandle *AH, TocEntry *te)
@@ -324,7 +323,6 @@ _WriteData(ArchiveHandle *AH, const void *data, size_t dLen)
  * finished.
  *
  * Optional.
- *
  */
 static void
 _EndData(ArchiveHandle *AH, TocEntry *te)
@@ -529,8 +527,8 @@ _LoadBlobs(ArchiveHandle *AH, bool drop)
 /*
  * Skip the BLOBs from the current file position.
  * BLOBS are written sequentially as data blocks (see below).
- * Each BLOB is preceded by it's original OID.
- * A zero OID indicated the end of the BLOBS
+ * Each BLOB is preceded by its original OID.
+ * A zero OID indicates the end of the BLOBS
  */
 static void
 _skipBlobs(ArchiveHandle *AH)
@@ -548,7 +546,7 @@ _skipBlobs(ArchiveHandle *AH)
 /*
  * Skip data from current file position.
  * Data blocks are formatted as an integer length, followed by data.
- * A zero length denoted the end of the block.
+ * A zero length indicates the end of the block.
 */
 static void
 _skipData(ArchiveHandle *AH)
-- 
2.17.0

v5-0004-typo.patchtext/x-diff; charset=us-asciiDownload
From 8f435e9e75c2b7f3c197ffa61b5849fcabf1a040 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 3 May 2020 21:22:05 -0500
Subject: [PATCH v5 4/5] typo

---
 src/backend/replication/logical/relation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c
index 02164f8d9b..e1a447e097 100644
--- a/src/backend/replication/logical/relation.c
+++ b/src/backend/replication/logical/relation.c
@@ -576,7 +576,7 @@ logicalrep_partmap_init(void)
  * the attribute map, which can be different for the partition.
  *
  * Note there's no logicalrep_partition_close, because the caller closes the
- * the component relation.
+ * component relation.
  */
 LogicalRepRelMapEntry *
 logicalrep_partition_open(LogicalRepRelMapEntry *root,
-- 
2.17.0

v5-0005-unused-variable-found-AttrDefaultFetch.patchtext/x-diff; charset=us-asciiDownload
From e16b432f2b84f8868256dbfe500cd481de8b4504 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 23 Apr 2020 21:54:27 -0500
Subject: [PATCH v5 5/5] unused variable found@AttrDefaultFetch()..

since:
commit 16828d5c0273b4fe5f10f42588005f16b415b2d8
Author: Andrew Dunstan <andrew@dunslane.net>
Date:   Wed Mar 28 10:43:52 2018 +1030

    Fast ALTER TABLE ADD COLUMN with a non-NULL default
---
 src/backend/utils/cache/relcache.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 0b9eb00d2d..f964cc7051 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -4240,7 +4240,6 @@ AttrDefaultFetch(Relation relation)
 	HeapTuple	htup;
 	Datum		val;
 	bool		isnull;
-	int			found;
 	int			i;
 
 	ScanKeyInit(&skey,
@@ -4251,7 +4250,6 @@ AttrDefaultFetch(Relation relation)
 	adrel = table_open(AttrDefaultRelationId, AccessShareLock);
 	adscan = systable_beginscan(adrel, AttrDefaultIndexId, true,
 								NULL, 1, &skey);
-	found = 0;
 
 	while (HeapTupleIsValid(htup = systable_getnext(adscan)))
 	{
@@ -4266,8 +4264,6 @@ AttrDefaultFetch(Relation relation)
 				elog(WARNING, "multiple attrdef records found for attr %s of rel %s",
 					 NameStr(attr->attname),
 					 RelationGetRelationName(relation));
-			else
-				found++;
 
 			val = fastgetattr(htup,
 							  Anum_pg_attrdef_adbin,
-- 
2.17.0

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

On Thu, Jun 11, 2020 at 09:37:09PM -0500, Justin Pryzby wrote:

Some new bits,
And some old ones.

I was looking at this patch set, and 0005 has attracted my attention
here:

--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -4240,7 +4240,6 @@ AttrDefaultFetch(Relation relation)
HeapTuple	htup;
Datum		val;
bool		isnull;
-	int			found;
int			i;

Since 16828d5, this variable is indeed unused. Now, the same commit
has removed the following code:
- if (found != ndef)
- elog(WARNING, "%d attrdef record(s) missing for rel %s",
- ndef - found, RelationGetRelationName(relation));

Should we actually keep this variable and have this sanity check in
place? It seems to me that it would be good to have that, so as we
can make sure that the number of default attributes cached matches
with the number of defaults actually found when scanning each
attribute. Adding in CC Andrew as the author of 16828d5 for more
input.
--
Michael

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

On Thu, Jun 11, 2020 at 09:37:09PM -0500, Justin Pryzby wrote:

Some new bits,
And some old ones.

I have merged 0003 and 0004 together and applied them. 0005 seems to
have a separate issue as mentioned upthread, and I have not really
looked at 0001 and 0002. Thanks.
--
Michael

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

On Fri, Jun 12, 2020 at 09:13:02PM +0900, Michael Paquier wrote:

I have merged 0003 and 0004 together and applied them. 0005 seems to
have a separate issue as mentioned upthread, and I have not really
looked at 0001 and 0002. Thanks.

And committed 0001 and 0002 after some tiny adjustments as of
7a3543c.
--
Michael

#16Justin Pryzby
pryzby@telsasoft.com
In reply to: Justin Pryzby (#5)
10 attachment(s)
Re: doc review for v13

I stand by these changes which I proposed handful of times since April, but not
yet included by Michael's previous commits.

--
Justin

Attachments:

v6-0001-doc-btree-deduplication.patchtext/x-diff; charset=us-asciiDownload
From f029efd79c4ad14ae003ed1a1c692931cdc33f1e Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 30 Mar 2020 19:43:22 -0500
Subject: [PATCH v6 01/10] doc: btree deduplication

commit 0d861bbb702f8aa05c2a4e3f1650e7e8df8c8c27
Author: Peter Geoghegan <pg@bowt.ie>
---
 doc/src/sgml/btree.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/btree.sgml b/doc/src/sgml/btree.sgml
index d03ee4d6fa..69c1ee0e97 100644
--- a/doc/src/sgml/btree.sgml
+++ b/doc/src/sgml/btree.sgml
@@ -642,7 +642,7 @@ options(<replaceable>relopts</replaceable> <type>local_relopts *</type>) returns
   </para>
   <para>
    Deduplication works by periodically merging groups of duplicate
-   tuples together, forming a single posting list tuple for each
+   tuples together, forming a single <firstterm>posting list</firstterm> tuple for each
    group.  The column key value(s) only appear once in this
    representation.  This is followed by a sorted array of
    <acronym>TID</acronym>s that point to rows in the table.  This
-- 
2.17.0

v6-0002-doc-pg_stat_progress_basebackup.patchtext/x-diff; charset=us-asciiDownload
From aff29ab082f8915bd5fdfc9a763e23c864e555e0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 21:22:43 -0500
Subject: [PATCH v6 02/10] doc: pg_stat_progress_basebackup

commit e65497df8f85ab9b9084c928ff69f384ea729b24
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 304c49f07b..ea8780327f 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -6069,8 +6069,8 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
       <entry><literal>waiting for checkpoint to finish</literal></entry>
       <entry>
        The WAL sender process is currently performing
-       <function>pg_start_backup</function> to set up for
-       taking a base backup, and waiting for backup start
+       <function>pg_start_backup</function> to prepare to
+       take a base backup, and waiting for the start-of-backup
        checkpoint to finish.
       </entry>
      </row>
-- 
2.17.0

v6-0003-Fix-docs-time-of-the.patchtext/x-diff; charset=us-asciiDownload
From 0949708420623878995ef82d26fed2348edad941 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 5 Apr 2020 22:35:09 -0500
Subject: [PATCH v6 03/10] Fix docs: "time of the"

commit 9e257a181cc1dc5e19eb5d770ce09cc98f470f5f
Author: Andrew Dunstan <andrew@dunslane.net>
Date:   Sun Mar 24 11:27:20 2013 -0400

    Add parallel pg_dump option.

commit 5ab892c391c6bc54a00e7a8de5cab077cabace6a
Author: Michael Paquier <michael@paquier.xyz>
Date:   Sat Jul 27 22:21:18 2019 +0900

    Add support for --jobs in reindexdb

commit a17923204736d8842eade3517d6a8ee81290fca4
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:   Fri Jan 23 15:02:45 2015 -0300

    vacuumdb: enable parallel mode
---
 doc/src/sgml/ref/pg_dump.sgml   | 2 +-
 doc/src/sgml/ref/reindexdb.sgml | 4 ++--
 doc/src/sgml/ref/vacuumdb.sgml  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index 7a37fd8045..77029defc5 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -322,7 +322,7 @@ PostgreSQL documentation
       <listitem>
        <para>
         Run the dump in parallel by dumping <replaceable class="parameter">njobs</replaceable>
-        tables simultaneously. This option reduces the time of the dump but it also
+        tables simultaneously. This option may reduces the time needed to perform the dump but it also
         increases the load on the database server. You can only use this option with the
         directory output format because this is the only output format where multiple processes
         can write their data at the same time.
diff --git a/doc/src/sgml/ref/reindexdb.sgml b/doc/src/sgml/ref/reindexdb.sgml
index 026fd018d9..4f821c2095 100644
--- a/doc/src/sgml/ref/reindexdb.sgml
+++ b/doc/src/sgml/ref/reindexdb.sgml
@@ -174,8 +174,8 @@ PostgreSQL documentation
        <para>
         Execute the reindex commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option may reduce the processing time
+        but it also increases the load on the database server.
        </para>
        <para>
         <application>reindexdb</application> will open
diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml
index 95d6894cb0..7b13950552 100644
--- a/doc/src/sgml/ref/vacuumdb.sgml
+++ b/doc/src/sgml/ref/vacuumdb.sgml
@@ -155,8 +155,8 @@ PostgreSQL documentation
        <para>
         Execute the vacuum or analyze commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option may reduce the processing time
+        but it also increases the load on the database server.
        </para>
        <para>
         <application>vacuumdb</application> will open
-- 
2.17.0

v6-0004-doc-Allow-users-to-limit-storage-reserved-by-repl.patchtext/x-diff; charset=us-asciiDownload
From 0457a0038e2c4fc473dbdbbeb3536426b5939bcd Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 7 Apr 2020 19:56:56 -0500
Subject: [PATCH v6 04/10] doc: Allow users to limit storage reserved by
 replication slots

commit c6550776394e25c1620bc8258427c8f1d448080d
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
---
 doc/src/sgml/config.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 7a7177c550..190157df0a 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3900,9 +3900,9 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         slots</link> are allowed to retain in the <filename>pg_wal</filename>
         directory at checkpoint time.
         If <varname>max_slot_wal_keep_size</varname> is -1 (the default),
-        replication slots retain unlimited amount of WAL files.  If
-        restart_lsn of a replication slot gets behind more than that megabytes
-        from the current LSN, the standby using the slot may no longer be able
+        replication slots may retain an unlimited amount of WAL files.  Otherwise, if
+        restart_lsn of a replication slot falls behind the current LSN by more
+        than the given size, the standby using the slot may no longer be able
         to continue replication due to removal of required WAL files. You
         can see the WAL availability of replication slots
         in <link linkend="view-pg-replication-slots">pg_replication_slots</link>.
-- 
2.17.0

v6-0005-doc-s-evade-avoid.patchtext/x-diff; charset=us-asciiDownload
From 98621608b7dddcc81e6bcf58489179a1af4ac6db Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 6 Apr 2020 17:16:07 -0500
Subject: [PATCH v6 05/10] doc: s/evade/avoid/

---
 src/backend/access/gin/README         | 2 +-
 src/backend/utils/adt/jsonpath_exec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/access/gin/README b/src/backend/access/gin/README
index 125a82219b..41d4e1e8a0 100644
--- a/src/backend/access/gin/README
+++ b/src/backend/access/gin/README
@@ -413,7 +413,7 @@ leftmost leaf of the tree.
 Deletion algorithm keeps exclusive locks on left siblings of pages comprising
 currently investigated path.  Thus, if current page is to be removed, all
 required pages to remove both downlink and rightlink are already locked.  That
-evades potential right to left page locking order, which could deadlock with
+avoids potential right to left page locking order, which could deadlock with
 concurrent stepping right.
 
 A search concurrent to page deletion might already have read a pointer to the
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index f146767bfc..2d2eb7d7a3 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -35,7 +35,7 @@
  * executeItemOptUnwrapTarget() function have 'unwrap' argument, which indicates
  * whether unwrapping of array is needed.  When unwrap == true, each of array
  * members is passed to executeItemOptUnwrapTarget() again but with unwrap == false
- * in order to evade subsequent array unwrapping.
+ * in order to avoid subsequent array unwrapping.
  *
  * All boolean expressions (predicates) are evaluated by executeBoolItem()
  * function, which returns tri-state JsonPathBool.  When error is occurred
-- 
2.17.0

v6-0006-doc-Add-logical-replication-support-to-replicate-.patchtext/x-diff; charset=us-asciiDownload
From 8b0e892916b9918e688624632427ce1ed26c466a Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 10:05:21 -0500
Subject: [PATCH v6 06/10] doc: Add logical replication support to replicate
 into partitioned tables

commit f1ac27bfda6ce8a399d8001843e9aefff5814f9b
Author: Peter Eisentraut <peter@eisentraut.org>
---
 doc/src/sgml/logical-replication.sgml      | 2 +-
 src/backend/replication/logical/relation.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index 3f69b71926..d2cdd13c58 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -404,7 +404,7 @@
     <para>
      Replication is only supported by tables, including partitioned tables.
      Attempts to replicate other types of relations such as views, materialized
-     views, or foreign tables, will result in an error.
+     views, or foreign tables will result in an error.
     </para>
    </listitem>
 
diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c
index a60c73d74d..e1a447e097 100644
--- a/src/backend/replication/logical/relation.c
+++ b/src/backend/replication/logical/relation.c
@@ -631,7 +631,7 @@ logicalrep_partition_open(LogicalRepRelMapEntry *root,
 	/*
 	 * If the partition's attributes don't match the root relation's, we'll
 	 * need to make a new attrmap which maps partition attribute numbers to
-	 * remoterel's, instead the original which maps root relation's attribute
+	 * remoterel's, instead of the original which maps root relation's attribute
 	 * numbers to remoterel's.
 	 *
 	 * Note that 'map' which comes from the tuple routing data structure
-- 
2.17.0

v6-0007-is-vs-are-plural.patchtext/x-diff; charset=us-asciiDownload
From e2e2f62be846d2cd5df61e17390e04303d154279 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 4 Apr 2019 18:57:48 -0500
Subject: [PATCH v6 07/10] is vs are plural

Should backpatch to v12
---
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 doc/src/sgml/sources.sgml         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index b2eb7097a9..fa848e0bdf 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -889,7 +889,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       from the parent table will be created in the partition, if they don't
       already exist.
       If any of the <literal>CHECK</literal> constraints of the table being
-      attached is marked <literal>NO INHERIT</literal>, the command will fail;
+      attached are marked <literal>NO INHERIT</literal>, the command will fail;
       such constraints must be recreated without the
       <literal>NO INHERIT</literal> clause.
      </para>
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 283c3e0357..12704c6fdf 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -466,8 +466,8 @@ Hint:       the addendum
     enough for error messages.  Detail and hint messages can be relegated to a
     verbose mode, or perhaps a pop-up error-details window.  Also, details and
     hints would normally be suppressed from the server log to save
-    space. Reference to implementation details is best avoided since users
-    aren't expected to know the details.
+    space. References to implementation details are best avoided since users
+    aren't expected to know them.
    </para>
 
   </simplesect>
-- 
2.17.0

v6-0008-doc-backup-manifests.patchtext/x-diff; charset=us-asciiDownload
From 548e8190ae4b4efd293916b7cb90af41cf44ef2f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 3 Apr 2020 16:17:28 -0500
Subject: [PATCH v6 08/10] doc: backup manifests

commit 0d8c9c1210c44b36ec2efcb223a1dfbe897a3661
Author: Robert Haas <rhaas@postgresql.org>

Previously reported here:
https://www.postgresql.org/message-id/20200403212445.GB12283%40telsasoft.com
---
 doc/src/sgml/protocol.sgml            | 4 ++--
 doc/src/sgml/ref/pg_basebackup.sgml   | 4 ++--
 doc/src/sgml/ref/pg_verifybackup.sgml | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 8b00235a51..c402b97903 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2586,7 +2586,7 @@ The commands accepted in replication mode are:
           and sent along with the backup.  The manifest is a list of every
           file present in the backup with the exception of any WAL files that
           may be included. It also stores the size, last modification time, and
-          an optional checksum for each file.
+          optionally a checksum for each file.
           A value of <literal>force-encode</literal> forces all filenames
           to be hex-encoded; otherwise, this type of encoding is performed only
           for files whose names are non-UTF8 octet sequences.
@@ -2602,7 +2602,7 @@ The commands accepted in replication mode are:
         <term><literal>MANIFEST_CHECKSUMS</literal> <replaceable>checksum_algorithm</replaceable></term>
         <listitem>
          <para>
-          Specifies the algorithm that should be applied to each file included
+          Specifies the checksum algorithm that should be applied to each file included
           in the backup manifest. Currently, the available
           algorithms are <literal>NONE</literal>, <literal>CRC32C</literal>,
           <literal>SHA224</literal>, <literal>SHA256</literal>,
diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index aa0b27c9f3..024adcb0b5 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -530,7 +530,7 @@ PostgreSQL documentation
         not contain any checksums. Otherwise, it will contain a checksum
         of each file in the backup using the specified algorithm. In addition,
         the manifest will always contain a <literal>SHA256</literal>
-        checksum of its own contents. The <literal>SHA</literal> algorithms
+        checksum of its own content. The <literal>SHA</literal> algorithms
         are significantly more CPU-intensive than <literal>CRC32C</literal>,
         so selecting one of them may increase the time required to complete
         the backup.
@@ -540,7 +540,7 @@ PostgreSQL documentation
         of each file for users who wish to verify that the backup has not been
         tampered with, while the CRC32C algorithm provides a checksum that is
         much faster to calculate; it is good at catching errors due to accidental
-        changes but is not resistant to targeted modifications.  Note that, to
+        changes but is not resistant to malicious modifications.  Note that, to
         be useful against an adversary who has access to the backup, the backup
         manifest would need to be stored securely elsewhere or otherwise
         verified not to have been modified since the backup was taken.
diff --git a/doc/src/sgml/ref/pg_verifybackup.sgml b/doc/src/sgml/ref/pg_verifybackup.sgml
index c160992e6d..b12e134a44 100644
--- a/doc/src/sgml/ref/pg_verifybackup.sgml
+++ b/doc/src/sgml/ref/pg_verifybackup.sgml
@@ -44,7 +44,7 @@ PostgreSQL documentation
    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
-   expected and that they appear to contain the correct data. However,
+   expected and that they contain the correct data. However,
    <application>pg_verifybackup</application> can detect many problems
    that commonly occur due to storage problems or user error.
   </para>
@@ -82,7 +82,7 @@ PostgreSQL documentation
    for any files for which the computed checksum does not match the
    checksum stored in the manifest. This step is not performed for any files
    which produced errors in the previous step, since they are already known
-   to have problems. Also, files which were ignored in the previous step are
+   to have problems. Files which were ignored in the previous step are
    also ignored in this step.
   </para>
 
@@ -121,7 +121,7 @@ PostgreSQL documentation
   <title>Options</title>
 
    <para>
-    The following command-line options control the behavior.
+    The following command-line options control the behavior of this program.
 
     <variablelist>
      <varlistentry>
-- 
2.17.0

v6-0009-Say-it-more-naturally.patchtext/x-diff; charset=us-asciiDownload
From db936e2bb09d9e5fd184f85900d9b25dae220931 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 9 Jul 2019 10:42:26 -0500
Subject: [PATCH v6 09/10] Say it more naturally

Originally submitted here and never integrated.
https://www.postgresql.org/message-id/flat/20190427025647.GD3925%40telsasoft.com#e1731c33455145eadc1158042cc411f9

Should backpatch to v12
---
 doc/src/sgml/config.sgml          | 2 +-
 doc/src/sgml/ddl.sgml             | 2 +-
 doc/src/sgml/libpq.sgml           | 2 +-
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 doc/src/sgml/ref/pg_rewind.sgml   | 4 ++--
 doc/src/sgml/ref/reindex.sgml     | 2 +-
 doc/src/sgml/runtime.sgml         | 2 +-
 doc/src/sgml/sources.sgml         | 4 ++--
 8 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 190157df0a..6a7548454e 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3811,7 +3811,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         servers or streaming base backup clients (i.e., the maximum number of
         simultaneously running WAL sender processes). The default is
         <literal>10</literal>.  The value <literal>0</literal> means
-        replication is disabled.  Abrupt streaming client disconnection might
+        replication is disabled.  Abrupt disconnection of a streaming client might
         leave an orphaned connection slot behind until a timeout is reached,
         so this parameter should be set slightly higher than the maximum
         number of expected clients so disconnected clients can immediately
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index f45c951b2b..73cbc35e97 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3992,7 +3992,7 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02
      Before running the <command>ATTACH PARTITION</command> command, it is
      recommended to create a <literal>CHECK</literal> constraint on the table to
      be attached matching the desired partition constraint. That way,
-     the system will be able to skip the scan to validate the implicit
+     the system will be able to skip the scan which is otherwise needed to validate the implicit
      partition constraint. Without the <literal>CHECK</literal> constraint,
      the table will be scanned to validate the partition constraint while
      holding an <literal>ACCESS EXCLUSIVE</literal> lock on that partition
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index f7b765f76d..20c7782ada 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -1223,7 +1223,7 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
       <term><literal>connect_timeout</literal></term>
       <listitem>
       <para>
-       Maximum wait for connection, in seconds (write as a decimal integer,
+       Maximum time to wait while connecting, in seconds (write as a decimal integer,
        e.g. <literal>10</literal>).  Zero, negative, or not specified means
        wait indefinitely.  The minimum allowed timeout is 2 seconds, therefore
        a value of <literal>1</literal> is interpreted as <literal>2</literal>.
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index fa848e0bdf..69151783f7 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -669,7 +669,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       When applied to a partitioned table, nothing is moved, but any
       partitions created afterwards with
       <command>CREATE TABLE PARTITION OF</command> will use that tablespace,
-      unless the <literal>TABLESPACE</literal> clause is used to override it.
+      unless overridden by its <literal>TABLESPACE</literal> clause.
      </para>
 
      <para>
diff --git a/doc/src/sgml/ref/pg_rewind.sgml b/doc/src/sgml/ref/pg_rewind.sgml
index 440eed7d4b..fd4946c9a2 100644
--- a/doc/src/sgml/ref/pg_rewind.sgml
+++ b/doc/src/sgml/ref/pg_rewind.sgml
@@ -211,7 +211,7 @@ PostgreSQL documentation
         <command>pg_rewind</command> to return without waiting, which is
         faster, but means that a subsequent operating system crash can leave
         the synchronized data directory corrupt.  Generally, this option is
-        useful for testing but should not be used when creating a production
+        useful for testing but should not be used on a production
         installation.
        </para>
       </listitem>
@@ -322,7 +322,7 @@ GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, b
   <para>
    When executing <application>pg_rewind</application> using an online
    cluster as source which has been recently promoted, it is necessary
-   to execute a <command>CHECKPOINT</command> after promotion so as its
+   to execute a <command>CHECKPOINT</command> after promotion such that its
    control file reflects up-to-date timeline information, which is used by
    <application>pg_rewind</application> to check if the target cluster
    can be rewound using the designated source cluster.
diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml
index aac5d5be23..2acc10b656 100644
--- a/doc/src/sgml/ref/reindex.sgml
+++ b/doc/src/sgml/ref/reindex.sgml
@@ -248,7 +248,7 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
   <para>
    Reindexing a single index or table requires being the owner of that
    index or table.  Reindexing a schema or database requires being the
-   owner of that schema or database.  Note that is therefore sometimes
+   owner of that schema or database.  Note specifically that it's
    possible for non-superusers to rebuild indexes of tables owned by
    other users.  However, as a special exception, when
    <command>REINDEX DATABASE</command>, <command>REINDEX SCHEMA</command>
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index c8698898f3..4e0ef55304 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -2510,7 +2510,7 @@ openssl x509 -req -in server.csr -text -days 365 \
    <para>
     The <productname>PostgreSQL</productname> server will listen for both
     normal and <acronym>GSSAPI</acronym>-encrypted connections on the same TCP
-    port, and will negotiate with any connecting client on whether to
+    port, and will negotiate with any connecting client whether to
     use <acronym>GSSAPI</acronym> for encryption (and for authentication).  By
     default, this decision is up to the client (which means it can be
     downgraded by an attacker); see <xref linkend="auth-pg-hba-conf"/> about
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 12704c6fdf..5a8dbcb4d3 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -373,7 +373,7 @@ ereport(ERROR,
      specify suppression of the <literal>CONTEXT:</literal> portion of a message in
      the postmaster log.  This should only be used for verbose debugging
      messages where the repeated inclusion of context would bloat the log
-     volume too much.
+     too much.
     </para>
    </listitem>
   </itemizedlist>
@@ -518,7 +518,7 @@ Hint:       the addendum
    <title>Use of Quotes</title>
 
    <para>
-    Use quotes always to delimit file names, user-supplied identifiers, and
+    Always use quotes to delimit file names, user-supplied identifiers, and
     other variables that might contain words.  Do not use them to mark up
     variables that will not contain words (for example, operator names).
    </para>
-- 
2.17.0

v6-0010-Say-re-sent-not-resent.patchtext/x-diff; charset=us-asciiDownload
From 89861d184ced659120addaf038e95da99a42db7b Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 21:14:47 -0500
Subject: [PATCH v6 10/10] Say "re-sent" not "resent"..

..which means "feel bitter or indignant about"
---
 doc/src/sgml/logicaldecoding.sgml         | 2 +-
 doc/src/sgml/ref/create_subscription.sgml | 2 +-
 src/backend/storage/lmgr/proc.c           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index 1571d71a5b..145c36f567 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -223,7 +223,7 @@ $ pg_recvlogical -d postgres --slot=test --drop-slot
      A logical slot will emit each change just once in normal operation.
      The current position of each slot is persisted only at checkpoint, so in
      the case of a crash the slot may return to an earlier LSN, which will
-     then cause recent changes to be resent when the server restarts.
+     then cause recent changes to be re-sent when the server restarts.
      Logical decoding clients are responsible for avoiding ill effects from
      handling the same message more than once.  Clients may wish to record
      the last LSN they saw when decoding and skip over any repeated data or
diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml
index cdb22c54fe..d1d3647f31 100644
--- a/doc/src/sgml/ref/create_subscription.sgml
+++ b/doc/src/sgml/ref/create_subscription.sgml
@@ -160,7 +160,7 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
          <para>
           It is safe to use <literal>off</literal> for logical replication:
           If the subscriber loses transactions because of missing
-          synchronization, the data will be resent from the publisher.
+          synchronization, the data will be re-sent from the publisher.
          </para>
 
          <para>
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index aa9fbd8054..fa2cac5e11 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -1369,7 +1369,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
 			else
 				LWLockRelease(ProcArrayLock);
 
-			/* prevent signal from being resent more than once */
+			/* prevent signal from being re-sent more than once */
 			allow_autovacuum_cancel = false;
 		}
 
-- 
2.17.0

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

On Tue, Aug 18, 2020 at 12:17:03PM -0500, Justin Pryzby wrote:

The WAL sender process is currently performing
-       <function>pg_start_backup</function> to set up for
-       taking a base backup, and waiting for backup start
+       <function>pg_start_backup</function> to prepare to
+       take a base backup, and waiting for the start-of-backup
checkpoint to finish.

Wouldn't it be more simple to use "to prepare for a base backup" here?

Run the dump in parallel by dumping <replaceable class="parameter">njobs</replaceable>
-        tables simultaneously. This option reduces the time of the dump but it also
+        tables simultaneously. This option may reduces the time needed to perform the dump but it also
increases the load on the database server. You can only use this option with the
[...]
Execute the reindex commands in parallel by running
<replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option may reduce the processing time
+        but it also increases the load on the database server.
[...]
Execute the vacuum or analyze commands in parallel by running
<replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option may reduce the processing time
+        but it also increases the load on the database server.
</para>
<para>
<application>vacuumdb</application> will open

The original versions are fine IMO.

Replication is only supported by tables, including partitioned tables.
Attempts to replicate other types of relations such as views, materialized
-     views, or foreign tables, will result in an error.
+     views, or foreign tables will result in an error.
</para>

I think that the original is fine.

* If the partition's attributes don't match the root relation's, we'll
* need to make a new attrmap which maps partition attribute numbers to
-	 * remoterel's, instead the original which maps root relation's attribute
+	 * remoterel's, instead of the original which maps root relation's attribute
* numbers to remoterel's.

Indeed.

from the parent table will be created in the partition, if they don't
already exist.
If any of the <literal>CHECK</literal> constraints of the table being
-      attached is marked <literal>NO INHERIT</literal>, the command will fail;
+      attached are marked <literal>NO INHERIT</literal>, the command will fail;
such constraints must be recreated without the
<literal>NO INHERIT</literal> clause.

Singular or plural depends on the context when if comes to any with a
countable word, and plural looks more natural to me here. So, right.

enough for error messages.  Detail and hint messages can be relegated to a
verbose mode, or perhaps a pop-up error-details window.  Also, details and
hints would normally be suppressed from the server log to save
-    space. Reference to implementation details is best avoided since users
-    aren't expected to know the details.
+    space. References to implementation details are best avoided since users
+    aren't expected to know them.

Original is fine IMO (see 6335c80).

not contain any checksums. Otherwise, it will contain a checksum
of each file in the backup using the specified algorithm. In addition,
the manifest will always contain a <literal>SHA256</literal>
-        checksum of its own contents. The <literal>SHA</literal> algorithms
+        checksum of its own content. The <literal>SHA</literal> algorithms
are significantly more CPU-intensive than <literal>CRC32C</literal>,
so selecting one of them may increase the time required to complete
the backup.
[...]
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
-   expected and that they appear to contain the correct data. However,
+   expected and that they contain the correct data. However,
<application>pg_verifybackup</application> can detect many problems
that commonly occur due to storage problems or user error.
[...]
@@ -82,7 +82,7 @@ PostgreSQL documentation
for any files for which the computed checksum does not match the
checksum stored in the manifest. This step is not performed for any files
which produced errors in the previous step, since they are already known
-   to have problems. Also, files which were ignored in the previous step are
+   to have problems. Files which were ignored in the previous step are
also ignored in this step.

No sure this needs to change

</para>

@@ -121,7 +121,7 @@ PostgreSQL documentation
<title>Options</title>

<para>
-    The following command-line options control the behavior.
+    The following command-line options control the behavior of this program.

"pg_verifybackup accepts the following command-line arguments:" is
more consistent with the style of all the other tools. This needs to
be fixed.

The <productname>PostgreSQL</productname> server will listen for both
normal and <acronym>GSSAPI</acronym>-encrypted connections on the same TCP
-    port, and will negotiate with any connecting client on whether to
+    port, and will negotiate with any connecting client whether to
use <acronym>GSSAPI</acronym> for encryption (and for authentication).  By

Right.

specify suppression of the <literal>CONTEXT:</literal> portion of a message in
the postmaster log. This should only be used for verbose debugging
messages where the repeated inclusion of context would bloat the log
- volume too much.
+ too much.

Okay here.

A logical slot will emit each change just once in normal operation.
The current position of each slot is persisted only at checkpoint, so in
the case of a crash the slot may return to an earlier LSN, which will
-     then cause recent changes to be resent when the server restarts.
+     then cause recent changes to be re-sent when the server restarts.
Logical decoding clients are responsible for avoiding ill effects from
handling the same message more than once.  Clients may wish to record
the last LSN they saw when decoding and skip over any repeated data or
[...]
It is safe to use <literal>off</literal> for logical replication:
If the subscriber loses transactions because of missing
-          synchronization, the data will be resent from the publisher.
+          synchronization, the data will be re-sent from the publisher.
</para>
[...]
-			/* prevent signal from being resent more than once */
+			/* prevent signal from being re-sent more than once */
allow_autovacuum_cancel = false;

"resent" is wrong, but "re-sent" does not sound like the best choice
to me. Shouldn't we just say "sent again" for all three places?
--
Michael

#18Justin Pryzby
pryzby@telsasoft.com
In reply to: Michael Paquier (#17)
10 attachment(s)
Re: doc review for v13

On Mon, Aug 31, 2020 at 04:28:20PM +0900, Michael Paquier wrote:

On Tue, Aug 18, 2020 at 12:17:03PM -0500, Justin Pryzby wrote:

The WAL sender process is currently performing
-       <function>pg_start_backup</function> to set up for
-       taking a base backup, and waiting for backup start
+       <function>pg_start_backup</function> to prepare to
+       take a base backup, and waiting for the start-of-backup
checkpoint to finish.

Wouldn't it be more simple to use "to prepare for a base backup" here?

I think it's useful to say "prepare to take" since it's more specific.. It's
not "preparing to receive" or "preparing to scan" or "preparing to parse".

Replication is only supported by tables, including partitioned tables.
Attempts to replicate other types of relations such as views, materialized
-     views, or foreign tables, will result in an error.
+     views, or foreign tables will result in an error.
</para>

I think that the original is fine.

I think this is indisputably wrong, but I realized that it's actually better
with an *additional* comma:

| Attempts to replicate other types of relations COMMA such as views, materialized
| views, or foreign tables, will result in an error.

</para>

@@ -121,7 +121,7 @@ PostgreSQL documentation
<title>Options</title>

<para>
-    The following command-line options control the behavior.
+    The following command-line options control the behavior of this program.

"pg_verifybackup accepts the following command-line arguments:" is
more consistent with the style of all the other tools. This needs to
be fixed.

-   to have problems. Also, files which were ignored in the previous step are
+   to have problems. Files which were ignored in the previous step are
also ignored in this step.

No sure this needs to change

Two "also"s seems poor, and the first one detracts from the 2nd.

the case of a crash the slot may return to an earlier LSN, which will
-     then cause recent changes to be resent when the server restarts.
+     then cause recent changes to be re-sent when the server restarts.
Logical decoding clients are responsible for avoiding ill effects from
handling the same message more than once.  Clients may wish to record
the last LSN they saw when decoding and skip over any repeated data or
[...]
It is safe to use <literal>off</literal> for logical replication:
If the subscriber loses transactions because of missing
-          synchronization, the data will be resent from the publisher.
+          synchronization, the data will be re-sent from the publisher.
</para>
[...]
-			/* prevent signal from being resent more than once */
+			/* prevent signal from being re-sent more than once */
allow_autovacuum_cancel = false;

"resent" is wrong, but "re-sent" does not sound like the best choice
to me. Shouldn't we just say "sent again" for all three places?

I don't think so.

--
Justin

Attachments:

v7-0003-doc-Allow-users-to-limit-storage-reserved-by-repl.patchtext/x-diff; charset=us-asciiDownload
From 2d7c3ca43db77c910e8cda4b53fd6c6b09421b40 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 7 Apr 2020 19:56:56 -0500
Subject: [PATCH v7 03/10] doc: Allow users to limit storage reserved by
 replication slots

commit c6550776394e25c1620bc8258427c8f1d448080d
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
---
 doc/src/sgml/config.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 7a7177c550..190157df0a 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3900,9 +3900,9 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         slots</link> are allowed to retain in the <filename>pg_wal</filename>
         directory at checkpoint time.
         If <varname>max_slot_wal_keep_size</varname> is -1 (the default),
-        replication slots retain unlimited amount of WAL files.  If
-        restart_lsn of a replication slot gets behind more than that megabytes
-        from the current LSN, the standby using the slot may no longer be able
+        replication slots may retain an unlimited amount of WAL files.  Otherwise, if
+        restart_lsn of a replication slot falls behind the current LSN by more
+        than the given size, the standby using the slot may no longer be able
         to continue replication due to removal of required WAL files. You
         can see the WAL availability of replication slots
         in <link linkend="view-pg-replication-slots">pg_replication_slots</link>.
-- 
2.17.0

v7-0004-doc-s-evade-avoid.patchtext/x-diff; charset=us-asciiDownload
From e06f8c6f048daa9829dc3bf0450caf5c099d9e4f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 6 Apr 2020 17:16:07 -0500
Subject: [PATCH v7 04/10] doc: s/evade/avoid/

---
 src/backend/access/gin/README         | 2 +-
 src/backend/utils/adt/jsonpath_exec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/access/gin/README b/src/backend/access/gin/README
index 125a82219b..41d4e1e8a0 100644
--- a/src/backend/access/gin/README
+++ b/src/backend/access/gin/README
@@ -413,7 +413,7 @@ leftmost leaf of the tree.
 Deletion algorithm keeps exclusive locks on left siblings of pages comprising
 currently investigated path.  Thus, if current page is to be removed, all
 required pages to remove both downlink and rightlink are already locked.  That
-evades potential right to left page locking order, which could deadlock with
+avoids potential right to left page locking order, which could deadlock with
 concurrent stepping right.
 
 A search concurrent to page deletion might already have read a pointer to the
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index f146767bfc..2d2eb7d7a3 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -35,7 +35,7 @@
  * executeItemOptUnwrapTarget() function have 'unwrap' argument, which indicates
  * whether unwrapping of array is needed.  When unwrap == true, each of array
  * members is passed to executeItemOptUnwrapTarget() again but with unwrap == false
- * in order to evade subsequent array unwrapping.
+ * in order to avoid subsequent array unwrapping.
  *
  * All boolean expressions (predicates) are evaluated by executeBoolItem()
  * function, which returns tri-state JsonPathBool.  When error is occurred
-- 
2.17.0

v7-0005-doc-Add-logical-replication-support-to-replicate-.patchtext/x-diff; charset=us-asciiDownload
From b3ed2b09c9cab03252c19b2809dbb68ab5798f60 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 10:05:21 -0500
Subject: [PATCH v7 05/10] doc: Add logical replication support to replicate
 into partitioned tables

commit f1ac27bfda6ce8a399d8001843e9aefff5814f9b
Author: Peter Eisentraut <peter@eisentraut.org>
---
 doc/src/sgml/logical-replication.sgml      | 2 +-
 src/backend/replication/logical/relation.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index 3f69b71926..28dae9ba67 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -403,7 +403,7 @@
    <listitem>
     <para>
      Replication is only supported by tables, including partitioned tables.
-     Attempts to replicate other types of relations such as views, materialized
+     Attempts to replicate other types of relations, such as views, materialized
      views, or foreign tables, will result in an error.
     </para>
    </listitem>
diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c
index a60c73d74d..e1a447e097 100644
--- a/src/backend/replication/logical/relation.c
+++ b/src/backend/replication/logical/relation.c
@@ -631,7 +631,7 @@ logicalrep_partition_open(LogicalRepRelMapEntry *root,
 	/*
 	 * If the partition's attributes don't match the root relation's, we'll
 	 * need to make a new attrmap which maps partition attribute numbers to
-	 * remoterel's, instead the original which maps root relation's attribute
+	 * remoterel's, instead of the original which maps root relation's attribute
 	 * numbers to remoterel's.
 	 *
 	 * Note that 'map' which comes from the tuple routing data structure
-- 
2.17.0

v7-0001-doc-btree-deduplication.patchtext/x-diff; charset=us-asciiDownload
From 137321a0d476f66b5e5f21c2f627c407330e50b1 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 30 Mar 2020 19:43:22 -0500
Subject: [PATCH v7 01/10] doc: btree deduplication

commit 0d861bbb702f8aa05c2a4e3f1650e7e8df8c8c27
Author: Peter Geoghegan <pg@bowt.ie>
---
 doc/src/sgml/btree.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/btree.sgml b/doc/src/sgml/btree.sgml
index d03ee4d6fa..69c1ee0e97 100644
--- a/doc/src/sgml/btree.sgml
+++ b/doc/src/sgml/btree.sgml
@@ -642,7 +642,7 @@ options(<replaceable>relopts</replaceable> <type>local_relopts *</type>) returns
   </para>
   <para>
    Deduplication works by periodically merging groups of duplicate
-   tuples together, forming a single posting list tuple for each
+   tuples together, forming a single <firstterm>posting list</firstterm> tuple for each
    group.  The column key value(s) only appear once in this
    representation.  This is followed by a sorted array of
    <acronym>TID</acronym>s that point to rows in the table.  This
-- 
2.17.0

v7-0002-doc-pg_stat_progress_basebackup.patchtext/x-diff; charset=us-asciiDownload
From fc883d317a895140771ce34564847bb9ca98b7e3 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 21:22:43 -0500
Subject: [PATCH v7 02/10] doc: pg_stat_progress_basebackup

commit e65497df8f85ab9b9084c928ff69f384ea729b24
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 304c49f07b..ea8780327f 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -6069,8 +6069,8 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
       <entry><literal>waiting for checkpoint to finish</literal></entry>
       <entry>
        The WAL sender process is currently performing
-       <function>pg_start_backup</function> to set up for
-       taking a base backup, and waiting for backup start
+       <function>pg_start_backup</function> to prepare to
+       take a base backup, and waiting for the start-of-backup
        checkpoint to finish.
       </entry>
      </row>
-- 
2.17.0

v7-0006-is-vs-are-plural.patchtext/x-diff; charset=us-asciiDownload
From eb48432879e84163a57d10230bbf7899ca53db1d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 4 Apr 2019 18:57:48 -0500
Subject: [PATCH v7 06/10] is vs are plural

Introduced:
commit f0e44751d7175fa3394da2c8f85e3ceb3cdbfe63
Author: Robert Haas <rhaas@postgresql.org>
Date:   Wed Dec 7 13:17:43 2016 -0500
---
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index b2eb7097a9..fa848e0bdf 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -889,7 +889,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       from the parent table will be created in the partition, if they don't
       already exist.
       If any of the <literal>CHECK</literal> constraints of the table being
-      attached is marked <literal>NO INHERIT</literal>, the command will fail;
+      attached are marked <literal>NO INHERIT</literal>, the command will fail;
       such constraints must be recreated without the
       <literal>NO INHERIT</literal> clause.
      </para>
-- 
2.17.0

v7-0007-doc-backup-manifests.patchtext/x-diff; charset=us-asciiDownload
From 0a6567cedf9d6f0b22e38f281f0b4752f6351a57 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 3 Apr 2020 16:17:28 -0500
Subject: [PATCH v7 07/10] doc: backup manifests

commit 0d8c9c1210c44b36ec2efcb223a1dfbe897a3661
Author: Robert Haas <rhaas@postgresql.org>

Previously reported here:
https://www.postgresql.org/message-id/20200403212445.GB12283%40telsasoft.com
---
 doc/src/sgml/protocol.sgml            | 4 ++--
 doc/src/sgml/ref/pg_basebackup.sgml   | 4 ++--
 doc/src/sgml/ref/pg_verifybackup.sgml | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 8b00235a51..c402b97903 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2586,7 +2586,7 @@ The commands accepted in replication mode are:
           and sent along with the backup.  The manifest is a list of every
           file present in the backup with the exception of any WAL files that
           may be included. It also stores the size, last modification time, and
-          an optional checksum for each file.
+          optionally a checksum for each file.
           A value of <literal>force-encode</literal> forces all filenames
           to be hex-encoded; otherwise, this type of encoding is performed only
           for files whose names are non-UTF8 octet sequences.
@@ -2602,7 +2602,7 @@ The commands accepted in replication mode are:
         <term><literal>MANIFEST_CHECKSUMS</literal> <replaceable>checksum_algorithm</replaceable></term>
         <listitem>
          <para>
-          Specifies the algorithm that should be applied to each file included
+          Specifies the checksum algorithm that should be applied to each file included
           in the backup manifest. Currently, the available
           algorithms are <literal>NONE</literal>, <literal>CRC32C</literal>,
           <literal>SHA224</literal>, <literal>SHA256</literal>,
diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index aa0b27c9f3..44e7b2444b 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -368,7 +368,7 @@ PostgreSQL documentation
    </para>
    <para>
     The following command-line options control the generation of the
-    backup and the running of the program:
+    backup and the invocation of the program:
 
     <variablelist>
      <varlistentry>
@@ -540,7 +540,7 @@ PostgreSQL documentation
         of each file for users who wish to verify that the backup has not been
         tampered with, while the CRC32C algorithm provides a checksum that is
         much faster to calculate; it is good at catching errors due to accidental
-        changes but is not resistant to targeted modifications.  Note that, to
+        changes but is not resistant to malicious modifications.  Note that, to
         be useful against an adversary who has access to the backup, the backup
         manifest would need to be stored securely elsewhere or otherwise
         verified not to have been modified since the backup was taken.
diff --git a/doc/src/sgml/ref/pg_verifybackup.sgml b/doc/src/sgml/ref/pg_verifybackup.sgml
index c160992e6d..4f72a1f126 100644
--- a/doc/src/sgml/ref/pg_verifybackup.sgml
+++ b/doc/src/sgml/ref/pg_verifybackup.sgml
@@ -82,7 +82,7 @@ PostgreSQL documentation
    for any files for which the computed checksum does not match the
    checksum stored in the manifest. This step is not performed for any files
    which produced errors in the previous step, since they are already known
-   to have problems. Also, files which were ignored in the previous step are
+   to have problems. Files which were ignored in the previous step are
    also ignored in this step.
   </para>
 
@@ -121,8 +121,8 @@ PostgreSQL documentation
   <title>Options</title>
 
    <para>
-    The following command-line options control the behavior.
-
+    <application>pg_verifybackup</application> accepts the following
+    command-line arguments:
     <variablelist>
      <varlistentry>
       <term><option>-e</option></term>
-- 
2.17.0

v7-0008-doc-pgbench-cmdline.patchtext/x-diff; charset=us-asciiDownload
From b791287b318c1dae14e4f6da3519d44913efb935 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 31 Aug 2020 08:19:37 -0500
Subject: [PATCH v7 08/10] doc: pgbench cmdline

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

diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml
index 9f3bb5fce6..afc49c2ecf 100644
--- a/doc/src/sgml/ref/pgbench.sgml
+++ b/doc/src/sgml/ref/pgbench.sgml
@@ -812,8 +812,8 @@ pgbench <optional> <replaceable>options</replaceable> </optional> <replaceable>d
   <title>Common Options</title>
 
    <para>
-    <application>pgbench</application> accepts the following command-line
-    common arguments:
+    <application>pgbench</application> also accepts the following command-line
+    arguments for connection parameters:
 
     <variablelist>
 
-- 
2.17.0

v7-0009-Say-it-more-naturally.patchtext/x-diff; charset=us-asciiDownload
From 78872819e35537c87ef64c3ef52c38953a378b41 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 9 Jul 2019 10:42:26 -0500
Subject: [PATCH v7 09/10] Say it more naturally

Originally submitted here and never integrated.
https://www.postgresql.org/message-id/flat/20190427025647.GD3925%40telsasoft.com#e1731c33455145eadc1158042cc411f9

Should backpatch to v12
---
 doc/src/sgml/config.sgml          | 2 +-
 doc/src/sgml/ddl.sgml             | 2 +-
 doc/src/sgml/libpq.sgml           | 2 +-
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 doc/src/sgml/ref/pg_rewind.sgml   | 4 ++--
 doc/src/sgml/ref/reindex.sgml     | 2 +-
 doc/src/sgml/runtime.sgml         | 2 +-
 doc/src/sgml/sources.sgml         | 4 ++--
 8 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 190157df0a..6a7548454e 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3811,7 +3811,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         servers or streaming base backup clients (i.e., the maximum number of
         simultaneously running WAL sender processes). The default is
         <literal>10</literal>.  The value <literal>0</literal> means
-        replication is disabled.  Abrupt streaming client disconnection might
+        replication is disabled.  Abrupt disconnection of a streaming client might
         leave an orphaned connection slot behind until a timeout is reached,
         so this parameter should be set slightly higher than the maximum
         number of expected clients so disconnected clients can immediately
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index f45c951b2b..73cbc35e97 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3992,7 +3992,7 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02
      Before running the <command>ATTACH PARTITION</command> command, it is
      recommended to create a <literal>CHECK</literal> constraint on the table to
      be attached matching the desired partition constraint. That way,
-     the system will be able to skip the scan to validate the implicit
+     the system will be able to skip the scan which is otherwise needed to validate the implicit
      partition constraint. Without the <literal>CHECK</literal> constraint,
      the table will be scanned to validate the partition constraint while
      holding an <literal>ACCESS EXCLUSIVE</literal> lock on that partition
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index f7b765f76d..20c7782ada 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -1223,7 +1223,7 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
       <term><literal>connect_timeout</literal></term>
       <listitem>
       <para>
-       Maximum wait for connection, in seconds (write as a decimal integer,
+       Maximum time to wait while connecting, in seconds (write as a decimal integer,
        e.g. <literal>10</literal>).  Zero, negative, or not specified means
        wait indefinitely.  The minimum allowed timeout is 2 seconds, therefore
        a value of <literal>1</literal> is interpreted as <literal>2</literal>.
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index fa848e0bdf..69151783f7 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -669,7 +669,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       When applied to a partitioned table, nothing is moved, but any
       partitions created afterwards with
       <command>CREATE TABLE PARTITION OF</command> will use that tablespace,
-      unless the <literal>TABLESPACE</literal> clause is used to override it.
+      unless overridden by its <literal>TABLESPACE</literal> clause.
      </para>
 
      <para>
diff --git a/doc/src/sgml/ref/pg_rewind.sgml b/doc/src/sgml/ref/pg_rewind.sgml
index 440eed7d4b..fd4946c9a2 100644
--- a/doc/src/sgml/ref/pg_rewind.sgml
+++ b/doc/src/sgml/ref/pg_rewind.sgml
@@ -211,7 +211,7 @@ PostgreSQL documentation
         <command>pg_rewind</command> to return without waiting, which is
         faster, but means that a subsequent operating system crash can leave
         the synchronized data directory corrupt.  Generally, this option is
-        useful for testing but should not be used when creating a production
+        useful for testing but should not be used on a production
         installation.
        </para>
       </listitem>
@@ -322,7 +322,7 @@ GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, b
   <para>
    When executing <application>pg_rewind</application> using an online
    cluster as source which has been recently promoted, it is necessary
-   to execute a <command>CHECKPOINT</command> after promotion so as its
+   to execute a <command>CHECKPOINT</command> after promotion such that its
    control file reflects up-to-date timeline information, which is used by
    <application>pg_rewind</application> to check if the target cluster
    can be rewound using the designated source cluster.
diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml
index aac5d5be23..2acc10b656 100644
--- a/doc/src/sgml/ref/reindex.sgml
+++ b/doc/src/sgml/ref/reindex.sgml
@@ -248,7 +248,7 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
   <para>
    Reindexing a single index or table requires being the owner of that
    index or table.  Reindexing a schema or database requires being the
-   owner of that schema or database.  Note that is therefore sometimes
+   owner of that schema or database.  Note specifically that it's
    possible for non-superusers to rebuild indexes of tables owned by
    other users.  However, as a special exception, when
    <command>REINDEX DATABASE</command>, <command>REINDEX SCHEMA</command>
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index c8698898f3..4e0ef55304 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -2510,7 +2510,7 @@ openssl x509 -req -in server.csr -text -days 365 \
    <para>
     The <productname>PostgreSQL</productname> server will listen for both
     normal and <acronym>GSSAPI</acronym>-encrypted connections on the same TCP
-    port, and will negotiate with any connecting client on whether to
+    port, and will negotiate with any connecting client whether to
     use <acronym>GSSAPI</acronym> for encryption (and for authentication).  By
     default, this decision is up to the client (which means it can be
     downgraded by an attacker); see <xref linkend="auth-pg-hba-conf"/> about
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 283c3e0357..25f79d2a1f 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -373,7 +373,7 @@ ereport(ERROR,
      specify suppression of the <literal>CONTEXT:</literal> portion of a message in
      the postmaster log.  This should only be used for verbose debugging
      messages where the repeated inclusion of context would bloat the log
-     volume too much.
+     too much.
     </para>
    </listitem>
   </itemizedlist>
@@ -518,7 +518,7 @@ Hint:       the addendum
    <title>Use of Quotes</title>
 
    <para>
-    Use quotes always to delimit file names, user-supplied identifiers, and
+    Always use quotes to delimit file names, user-supplied identifiers, and
     other variables that might contain words.  Do not use them to mark up
     variables that will not contain words (for example, operator names).
    </para>
-- 
2.17.0

v7-0010-Say-re-sent-not-resent.patchtext/x-diff; charset=us-asciiDownload
From 67162a0237ba1460a753290fbd1359cd3603004e Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 21:14:47 -0500
Subject: [PATCH v7 10/10] Say "re-sent" not "resent"..

..which means "feel bitter or indignant about"
---
 doc/src/sgml/logicaldecoding.sgml         | 2 +-
 doc/src/sgml/ref/create_subscription.sgml | 2 +-
 src/backend/storage/lmgr/proc.c           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index 1571d71a5b..145c36f567 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -223,7 +223,7 @@ $ pg_recvlogical -d postgres --slot=test --drop-slot
      A logical slot will emit each change just once in normal operation.
      The current position of each slot is persisted only at checkpoint, so in
      the case of a crash the slot may return to an earlier LSN, which will
-     then cause recent changes to be resent when the server restarts.
+     then cause recent changes to be re-sent when the server restarts.
      Logical decoding clients are responsible for avoiding ill effects from
      handling the same message more than once.  Clients may wish to record
      the last LSN they saw when decoding and skip over any repeated data or
diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml
index cdb22c54fe..d1d3647f31 100644
--- a/doc/src/sgml/ref/create_subscription.sgml
+++ b/doc/src/sgml/ref/create_subscription.sgml
@@ -160,7 +160,7 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
          <para>
           It is safe to use <literal>off</literal> for logical replication:
           If the subscriber loses transactions because of missing
-          synchronization, the data will be resent from the publisher.
+          synchronization, the data will be re-sent from the publisher.
          </para>
 
          <para>
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index aa9fbd8054..fa2cac5e11 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -1369,7 +1369,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
 			else
 				LWLockRelease(ProcArrayLock);
 
-			/* prevent signal from being resent more than once */
+			/* prevent signal from being re-sent more than once */
 			allow_autovacuum_cancel = false;
 		}
 
-- 
2.17.0

#19Michael Paquier
michael@paquier.xyz
In reply to: Justin Pryzby (#18)
Re: doc review for v13

On Mon, Aug 31, 2020 at 08:42:08AM -0500, Justin Pryzby wrote:

On Mon, Aug 31, 2020 at 04:28:20PM +0900, Michael Paquier wrote:

Wouldn't it be more simple to use "to prepare for a base backup" here?

I think it's useful to say "prepare to take" since it's more specific.. It's
not "preparing to receive" or "preparing to scan" or "preparing to parse".

Not sure I see the point in complicating the sentence here more than
necessary.

-   to have problems. Also, files which were ignored in the previous step are
+   to have problems. Files which were ignored in the previous step are
also ignored in this step.

No sure this needs to change

Two "also"s seems poor, and the first one detracts from the 2nd.

Ah, OK. Indeed.

"resent" is wrong, but "re-sent" does not sound like the best choice
to me. Shouldn't we just say "sent again" for all three places?

I don't think so.

Well, using "sent again" has the advantage to about any ambiguity in
the way it gets read. So I'd still prefer that when using the past
tense of "send" in those sentences. Any opinions from others?
--
Michael

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

I've added a few more.

--
Justin

Attachments:

v8-0001-doc-btree-deduplication.patchtext/x-diff; charset=us-asciiDownload
From 137321a0d476f66b5e5f21c2f627c407330e50b1 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 30 Mar 2020 19:43:22 -0500
Subject: [PATCH v8 01/14] doc: btree deduplication

commit 0d861bbb702f8aa05c2a4e3f1650e7e8df8c8c27
Author: Peter Geoghegan <pg@bowt.ie>
---
 doc/src/sgml/btree.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/btree.sgml b/doc/src/sgml/btree.sgml
index d03ee4d6fa..69c1ee0e97 100644
--- a/doc/src/sgml/btree.sgml
+++ b/doc/src/sgml/btree.sgml
@@ -642,7 +642,7 @@ options(<replaceable>relopts</replaceable> <type>local_relopts *</type>) returns
   </para>
   <para>
    Deduplication works by periodically merging groups of duplicate
-   tuples together, forming a single posting list tuple for each
+   tuples together, forming a single <firstterm>posting list</firstterm> tuple for each
    group.  The column key value(s) only appear once in this
    representation.  This is followed by a sorted array of
    <acronym>TID</acronym>s that point to rows in the table.  This
-- 
2.17.0

v8-0002-doc-pg_stat_progress_basebackup.patchtext/x-diff; charset=us-asciiDownload
From fc883d317a895140771ce34564847bb9ca98b7e3 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 21:22:43 -0500
Subject: [PATCH v8 02/14] doc: pg_stat_progress_basebackup

commit e65497df8f85ab9b9084c928ff69f384ea729b24
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 304c49f07b..ea8780327f 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -6069,8 +6069,8 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
       <entry><literal>waiting for checkpoint to finish</literal></entry>
       <entry>
        The WAL sender process is currently performing
-       <function>pg_start_backup</function> to set up for
-       taking a base backup, and waiting for backup start
+       <function>pg_start_backup</function> to prepare to
+       take a base backup, and waiting for the start-of-backup
        checkpoint to finish.
       </entry>
      </row>
-- 
2.17.0

v8-0003-doc-Allow-users-to-limit-storage-reserved-by-repl.patchtext/x-diff; charset=us-asciiDownload
From 2d7c3ca43db77c910e8cda4b53fd6c6b09421b40 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 7 Apr 2020 19:56:56 -0500
Subject: [PATCH v8 03/14] doc: Allow users to limit storage reserved by
 replication slots

commit c6550776394e25c1620bc8258427c8f1d448080d
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
---
 doc/src/sgml/config.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 7a7177c550..190157df0a 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3900,9 +3900,9 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         slots</link> are allowed to retain in the <filename>pg_wal</filename>
         directory at checkpoint time.
         If <varname>max_slot_wal_keep_size</varname> is -1 (the default),
-        replication slots retain unlimited amount of WAL files.  If
-        restart_lsn of a replication slot gets behind more than that megabytes
-        from the current LSN, the standby using the slot may no longer be able
+        replication slots may retain an unlimited amount of WAL files.  Otherwise, if
+        restart_lsn of a replication slot falls behind the current LSN by more
+        than the given size, the standby using the slot may no longer be able
         to continue replication due to removal of required WAL files. You
         can see the WAL availability of replication slots
         in <link linkend="view-pg-replication-slots">pg_replication_slots</link>.
-- 
2.17.0

v8-0004-doc-s-evade-avoid.patchtext/x-diff; charset=us-asciiDownload
From e06f8c6f048daa9829dc3bf0450caf5c099d9e4f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 6 Apr 2020 17:16:07 -0500
Subject: [PATCH v8 04/14] doc: s/evade/avoid/

---
 src/backend/access/gin/README         | 2 +-
 src/backend/utils/adt/jsonpath_exec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/access/gin/README b/src/backend/access/gin/README
index 125a82219b..41d4e1e8a0 100644
--- a/src/backend/access/gin/README
+++ b/src/backend/access/gin/README
@@ -413,7 +413,7 @@ leftmost leaf of the tree.
 Deletion algorithm keeps exclusive locks on left siblings of pages comprising
 currently investigated path.  Thus, if current page is to be removed, all
 required pages to remove both downlink and rightlink are already locked.  That
-evades potential right to left page locking order, which could deadlock with
+avoids potential right to left page locking order, which could deadlock with
 concurrent stepping right.
 
 A search concurrent to page deletion might already have read a pointer to the
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index f146767bfc..2d2eb7d7a3 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -35,7 +35,7 @@
  * executeItemOptUnwrapTarget() function have 'unwrap' argument, which indicates
  * whether unwrapping of array is needed.  When unwrap == true, each of array
  * members is passed to executeItemOptUnwrapTarget() again but with unwrap == false
- * in order to evade subsequent array unwrapping.
+ * in order to avoid subsequent array unwrapping.
  *
  * All boolean expressions (predicates) are evaluated by executeBoolItem()
  * function, which returns tri-state JsonPathBool.  When error is occurred
-- 
2.17.0

v8-0005-doc-Add-logical-replication-support-to-replicate-.patchtext/x-diff; charset=us-asciiDownload
From b3ed2b09c9cab03252c19b2809dbb68ab5798f60 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 10:05:21 -0500
Subject: [PATCH v8 05/14] doc: Add logical replication support to replicate
 into partitioned tables

commit f1ac27bfda6ce8a399d8001843e9aefff5814f9b
Author: Peter Eisentraut <peter@eisentraut.org>
---
 doc/src/sgml/logical-replication.sgml      | 2 +-
 src/backend/replication/logical/relation.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index 3f69b71926..28dae9ba67 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -403,7 +403,7 @@
    <listitem>
     <para>
      Replication is only supported by tables, including partitioned tables.
-     Attempts to replicate other types of relations such as views, materialized
+     Attempts to replicate other types of relations, such as views, materialized
      views, or foreign tables, will result in an error.
     </para>
    </listitem>
diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c
index a60c73d74d..e1a447e097 100644
--- a/src/backend/replication/logical/relation.c
+++ b/src/backend/replication/logical/relation.c
@@ -631,7 +631,7 @@ logicalrep_partition_open(LogicalRepRelMapEntry *root,
 	/*
 	 * If the partition's attributes don't match the root relation's, we'll
 	 * need to make a new attrmap which maps partition attribute numbers to
-	 * remoterel's, instead the original which maps root relation's attribute
+	 * remoterel's, instead of the original which maps root relation's attribute
 	 * numbers to remoterel's.
 	 *
 	 * Note that 'map' which comes from the tuple routing data structure
-- 
2.17.0

v8-0006-is-vs-are-plural.patchtext/x-diff; charset=us-asciiDownload
From eb48432879e84163a57d10230bbf7899ca53db1d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Thu, 4 Apr 2019 18:57:48 -0500
Subject: [PATCH v8 06/14] is vs are plural

Introduced:
commit f0e44751d7175fa3394da2c8f85e3ceb3cdbfe63
Author: Robert Haas <rhaas@postgresql.org>
Date:   Wed Dec 7 13:17:43 2016 -0500
---
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index b2eb7097a9..fa848e0bdf 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -889,7 +889,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       from the parent table will be created in the partition, if they don't
       already exist.
       If any of the <literal>CHECK</literal> constraints of the table being
-      attached is marked <literal>NO INHERIT</literal>, the command will fail;
+      attached are marked <literal>NO INHERIT</literal>, the command will fail;
       such constraints must be recreated without the
       <literal>NO INHERIT</literal> clause.
      </para>
-- 
2.17.0

v8-0007-doc-backup-manifests.patchtext/x-diff; charset=us-asciiDownload
From 0a6567cedf9d6f0b22e38f281f0b4752f6351a57 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 3 Apr 2020 16:17:28 -0500
Subject: [PATCH v8 07/14] doc: backup manifests

commit 0d8c9c1210c44b36ec2efcb223a1dfbe897a3661
Author: Robert Haas <rhaas@postgresql.org>

Previously reported here:
https://www.postgresql.org/message-id/20200403212445.GB12283%40telsasoft.com
---
 doc/src/sgml/protocol.sgml            | 4 ++--
 doc/src/sgml/ref/pg_basebackup.sgml   | 4 ++--
 doc/src/sgml/ref/pg_verifybackup.sgml | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 8b00235a51..c402b97903 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2586,7 +2586,7 @@ The commands accepted in replication mode are:
           and sent along with the backup.  The manifest is a list of every
           file present in the backup with the exception of any WAL files that
           may be included. It also stores the size, last modification time, and
-          an optional checksum for each file.
+          optionally a checksum for each file.
           A value of <literal>force-encode</literal> forces all filenames
           to be hex-encoded; otherwise, this type of encoding is performed only
           for files whose names are non-UTF8 octet sequences.
@@ -2602,7 +2602,7 @@ The commands accepted in replication mode are:
         <term><literal>MANIFEST_CHECKSUMS</literal> <replaceable>checksum_algorithm</replaceable></term>
         <listitem>
          <para>
-          Specifies the algorithm that should be applied to each file included
+          Specifies the checksum algorithm that should be applied to each file included
           in the backup manifest. Currently, the available
           algorithms are <literal>NONE</literal>, <literal>CRC32C</literal>,
           <literal>SHA224</literal>, <literal>SHA256</literal>,
diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index aa0b27c9f3..44e7b2444b 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -368,7 +368,7 @@ PostgreSQL documentation
    </para>
    <para>
     The following command-line options control the generation of the
-    backup and the running of the program:
+    backup and the invocation of the program:
 
     <variablelist>
      <varlistentry>
@@ -540,7 +540,7 @@ PostgreSQL documentation
         of each file for users who wish to verify that the backup has not been
         tampered with, while the CRC32C algorithm provides a checksum that is
         much faster to calculate; it is good at catching errors due to accidental
-        changes but is not resistant to targeted modifications.  Note that, to
+        changes but is not resistant to malicious modifications.  Note that, to
         be useful against an adversary who has access to the backup, the backup
         manifest would need to be stored securely elsewhere or otherwise
         verified not to have been modified since the backup was taken.
diff --git a/doc/src/sgml/ref/pg_verifybackup.sgml b/doc/src/sgml/ref/pg_verifybackup.sgml
index c160992e6d..4f72a1f126 100644
--- a/doc/src/sgml/ref/pg_verifybackup.sgml
+++ b/doc/src/sgml/ref/pg_verifybackup.sgml
@@ -82,7 +82,7 @@ PostgreSQL documentation
    for any files for which the computed checksum does not match the
    checksum stored in the manifest. This step is not performed for any files
    which produced errors in the previous step, since they are already known
-   to have problems. Also, files which were ignored in the previous step are
+   to have problems. Files which were ignored in the previous step are
    also ignored in this step.
   </para>
 
@@ -121,8 +121,8 @@ PostgreSQL documentation
   <title>Options</title>
 
    <para>
-    The following command-line options control the behavior.
-
+    <application>pg_verifybackup</application> accepts the following
+    command-line arguments:
     <variablelist>
      <varlistentry>
       <term><option>-e</option></term>
-- 
2.17.0

v8-0008-doc-pgbench-cmdline.patchtext/x-diff; charset=us-asciiDownload
From b791287b318c1dae14e4f6da3519d44913efb935 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 31 Aug 2020 08:19:37 -0500
Subject: [PATCH v8 08/14] doc: pgbench cmdline

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

diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml
index 9f3bb5fce6..afc49c2ecf 100644
--- a/doc/src/sgml/ref/pgbench.sgml
+++ b/doc/src/sgml/ref/pgbench.sgml
@@ -812,8 +812,8 @@ pgbench <optional> <replaceable>options</replaceable> </optional> <replaceable>d
   <title>Common Options</title>
 
    <para>
-    <application>pgbench</application> accepts the following command-line
-    common arguments:
+    <application>pgbench</application> also accepts the following command-line
+    arguments for connection parameters:
 
     <variablelist>
 
-- 
2.17.0

v8-0009-Say-it-more-naturally.patchtext/x-diff; charset=us-asciiDownload
From 78872819e35537c87ef64c3ef52c38953a378b41 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 9 Jul 2019 10:42:26 -0500
Subject: [PATCH v8 09/14] Say it more naturally

Originally submitted here and never integrated.
https://www.postgresql.org/message-id/flat/20190427025647.GD3925%40telsasoft.com#e1731c33455145eadc1158042cc411f9

Should backpatch to v12
---
 doc/src/sgml/config.sgml          | 2 +-
 doc/src/sgml/ddl.sgml             | 2 +-
 doc/src/sgml/libpq.sgml           | 2 +-
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 doc/src/sgml/ref/pg_rewind.sgml   | 4 ++--
 doc/src/sgml/ref/reindex.sgml     | 2 +-
 doc/src/sgml/runtime.sgml         | 2 +-
 doc/src/sgml/sources.sgml         | 4 ++--
 8 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 190157df0a..6a7548454e 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3811,7 +3811,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         servers or streaming base backup clients (i.e., the maximum number of
         simultaneously running WAL sender processes). The default is
         <literal>10</literal>.  The value <literal>0</literal> means
-        replication is disabled.  Abrupt streaming client disconnection might
+        replication is disabled.  Abrupt disconnection of a streaming client might
         leave an orphaned connection slot behind until a timeout is reached,
         so this parameter should be set slightly higher than the maximum
         number of expected clients so disconnected clients can immediately
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index f45c951b2b..73cbc35e97 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3992,7 +3992,7 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02
      Before running the <command>ATTACH PARTITION</command> command, it is
      recommended to create a <literal>CHECK</literal> constraint on the table to
      be attached matching the desired partition constraint. That way,
-     the system will be able to skip the scan to validate the implicit
+     the system will be able to skip the scan which is otherwise needed to validate the implicit
      partition constraint. Without the <literal>CHECK</literal> constraint,
      the table will be scanned to validate the partition constraint while
      holding an <literal>ACCESS EXCLUSIVE</literal> lock on that partition
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index f7b765f76d..20c7782ada 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -1223,7 +1223,7 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
       <term><literal>connect_timeout</literal></term>
       <listitem>
       <para>
-       Maximum wait for connection, in seconds (write as a decimal integer,
+       Maximum time to wait while connecting, in seconds (write as a decimal integer,
        e.g. <literal>10</literal>).  Zero, negative, or not specified means
        wait indefinitely.  The minimum allowed timeout is 2 seconds, therefore
        a value of <literal>1</literal> is interpreted as <literal>2</literal>.
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index fa848e0bdf..69151783f7 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -669,7 +669,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       When applied to a partitioned table, nothing is moved, but any
       partitions created afterwards with
       <command>CREATE TABLE PARTITION OF</command> will use that tablespace,
-      unless the <literal>TABLESPACE</literal> clause is used to override it.
+      unless overridden by its <literal>TABLESPACE</literal> clause.
      </para>
 
      <para>
diff --git a/doc/src/sgml/ref/pg_rewind.sgml b/doc/src/sgml/ref/pg_rewind.sgml
index 440eed7d4b..fd4946c9a2 100644
--- a/doc/src/sgml/ref/pg_rewind.sgml
+++ b/doc/src/sgml/ref/pg_rewind.sgml
@@ -211,7 +211,7 @@ PostgreSQL documentation
         <command>pg_rewind</command> to return without waiting, which is
         faster, but means that a subsequent operating system crash can leave
         the synchronized data directory corrupt.  Generally, this option is
-        useful for testing but should not be used when creating a production
+        useful for testing but should not be used on a production
         installation.
        </para>
       </listitem>
@@ -322,7 +322,7 @@ GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, b
   <para>
    When executing <application>pg_rewind</application> using an online
    cluster as source which has been recently promoted, it is necessary
-   to execute a <command>CHECKPOINT</command> after promotion so as its
+   to execute a <command>CHECKPOINT</command> after promotion such that its
    control file reflects up-to-date timeline information, which is used by
    <application>pg_rewind</application> to check if the target cluster
    can be rewound using the designated source cluster.
diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml
index aac5d5be23..2acc10b656 100644
--- a/doc/src/sgml/ref/reindex.sgml
+++ b/doc/src/sgml/ref/reindex.sgml
@@ -248,7 +248,7 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
   <para>
    Reindexing a single index or table requires being the owner of that
    index or table.  Reindexing a schema or database requires being the
-   owner of that schema or database.  Note that is therefore sometimes
+   owner of that schema or database.  Note specifically that it's
    possible for non-superusers to rebuild indexes of tables owned by
    other users.  However, as a special exception, when
    <command>REINDEX DATABASE</command>, <command>REINDEX SCHEMA</command>
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index c8698898f3..4e0ef55304 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -2510,7 +2510,7 @@ openssl x509 -req -in server.csr -text -days 365 \
    <para>
     The <productname>PostgreSQL</productname> server will listen for both
     normal and <acronym>GSSAPI</acronym>-encrypted connections on the same TCP
-    port, and will negotiate with any connecting client on whether to
+    port, and will negotiate with any connecting client whether to
     use <acronym>GSSAPI</acronym> for encryption (and for authentication).  By
     default, this decision is up to the client (which means it can be
     downgraded by an attacker); see <xref linkend="auth-pg-hba-conf"/> about
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 283c3e0357..25f79d2a1f 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -373,7 +373,7 @@ ereport(ERROR,
      specify suppression of the <literal>CONTEXT:</literal> portion of a message in
      the postmaster log.  This should only be used for verbose debugging
      messages where the repeated inclusion of context would bloat the log
-     volume too much.
+     too much.
     </para>
    </listitem>
   </itemizedlist>
@@ -518,7 +518,7 @@ Hint:       the addendum
    <title>Use of Quotes</title>
 
    <para>
-    Use quotes always to delimit file names, user-supplied identifiers, and
+    Always use quotes to delimit file names, user-supplied identifiers, and
     other variables that might contain words.  Do not use them to mark up
     variables that will not contain words (for example, operator names).
    </para>
-- 
2.17.0

v8-0010-s-periodical-periodic.patchtext/x-diff; charset=us-asciiDownload
From 7498474129c14746efc4222b239455349c8d4f30 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Sep 2020 18:48:04 -0500
Subject: [PATCH v8 10/14] s/periodical/periodic/

Since 6587818542e79012276dcfedb2f97e3522ee5e9b and 801c2dc72cb3c68a7c430bb244675b7a68fd541a
---
 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 6a7548454e..8ae73e5a72 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -8223,7 +8223,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
         set this value anywhere from zero to two billions, <command>VACUUM</command>
         will silently limit the effective value to 95% of
         <xref linkend="guc-autovacuum-freeze-max-age"/>, so that a
-        periodical manual <command>VACUUM</command> has a chance to run before an
+        periodic manual <command>VACUUM</command> has a chance to run before an
         anti-wraparound autovacuum is launched for the table. For more
         information see
         <xref linkend="vacuum-for-wraparound"/>.
@@ -8270,7 +8270,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
         Although users can set this value anywhere from zero to two billions,
         <command>VACUUM</command> will silently limit the effective value to 95% of
         <xref linkend="guc-autovacuum-multixact-freeze-max-age"/>, so that a
-        periodical manual <command>VACUUM</command> has a chance to run before an
+        periodic manual <command>VACUUM</command> has a chance to run before an
         anti-wraparound is launched for the table.
         For more information see <xref linkend="vacuum-for-multixact-wraparound"/>.
        </para>
-- 
2.17.0

v8-0011-doc-Improve-user-control-over-truncation-of-logge.patchtext/x-diff; charset=us-asciiDownload
From 5a8802741320e6fb4be754dd26f4d878c4e03317 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Sep 2020 20:48:46 -0500
Subject: [PATCH v8 11/14] doc: Improve user control over truncation of logged
 bind-parameter values.

0b34e7d307e6a142ee94800e6d5f3e73449eeffd
---
 doc/src/sgml/config.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 8ae73e5a72..d3df5a3566 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -6845,9 +6845,9 @@ log_line_prefix = '%m [%p] %q%u@%d/%a '
       </term>
       <listitem>
        <para>
-        If greater than zero, each bind parameter value reported in
-        non-error statement-logging messages is trimmed to this many bytes.
-        Zero disables logging bind parameters with statements.
+        If greater than zero, each bind parameter value logged by a
+        non-error statement-logging message is trimmed to this many bytes.
+        Zero disables logging of bind parameters for non-error statement logs.
         <literal>-1</literal> (the default) allows bind parameters to be
         logged in full.
         If this value is specified without units, it is taken as bytes.
-- 
2.17.0

v8-0012-Two-billions.patchtext/x-diff; charset=us-asciiDownload
From f3123e3d02224036556a98213b0328af6476ed66 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Sep 2020 18:49:28 -0500
Subject: [PATCH v8 12/14] Two billions

since: 801c2dc72cb3c68a7c430bb244675b7a68fd541a
---
 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 d3df5a3566..cbc6360f34 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -8220,7 +8220,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
         a regular <command>VACUUM</command> in that it visits every page that might
         contain unfrozen XIDs or MXIDs, not just those that might contain dead
         tuples.  The default is 150 million transactions.  Although users can
-        set this value anywhere from zero to two billions, <command>VACUUM</command>
+        set this value anywhere from zero to two billion, <command>VACUUM</command>
         will silently limit the effective value to 95% of
         <xref linkend="guc-autovacuum-freeze-max-age"/>, so that a
         periodic manual <command>VACUUM</command> has a chance to run before an
@@ -8267,7 +8267,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
         a regular <command>VACUUM</command> in that it visits every page that might
         contain unfrozen XIDs or MXIDs, not just those that might contain dead
         tuples.  The default is 150 million multixacts.
-        Although users can set this value anywhere from zero to two billions,
+        Although users can set this value anywhere from zero to two billion,
         <command>VACUUM</command> will silently limit the effective value to 95% of
         <xref linkend="guc-autovacuum-multixact-freeze-max-age"/>, so that a
         periodic manual <command>VACUUM</command> has a chance to run before an
-- 
2.17.0

v8-0013-Add-spaces-following-argument.patchtext/x-diff; charset=us-asciiDownload
From 3fb6fb6f672238f9f838bbe609b3779b5a8bc57d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Sep 2020 19:12:57 -0500
Subject: [PATCH v8 13/14] Add spaces following argument

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

diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 9a4ac5a1ea..8f7c7560af 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -15595,11 +15595,11 @@ table2-mapping
         <literal>'use_json_null'</literal>.
        </para>
        <para>
-        <literal>jsonb_set_lax('[{"f1":1,"f2":null},2,null,3]', '{0,f1}',null)</literal>
+        <literal>jsonb_set_lax('[{"f1":1,"f2":null},2,null,3]', '{0,f1}', null)</literal>
         <returnvalue>[{"f1":null,"f2":null},2,null,3]</returnvalue>
        </para>
        <para>
-        <literal>jsonb_set_lax('[{"f1":99,"f2":null},2]', '{0,f3}',null, true, 'return_target')</literal>
+        <literal>jsonb_set_lax('[{"f1":99,"f2":null},2]', '{0,f3}', null, true, 'return_target')</literal>
         <returnvalue>[{"f1": 99, "f2": null}, 2]</returnvalue>
        </para></entry>
       </row>
-- 
2.17.0

v8-0014-Say-re-sent-not-resent.patchtext/x-diff; charset=us-asciiDownload
From 2bc39c9f53618dd302a87165c0f9d1089e8acb19 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 21:14:47 -0500
Subject: [PATCH v8 14/14] Say "re-sent" not "resent"..

..which means "feel bitter or indignant about"
---
 doc/src/sgml/logicaldecoding.sgml         | 2 +-
 doc/src/sgml/ref/create_subscription.sgml | 2 +-
 src/backend/storage/lmgr/proc.c           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index 1571d71a5b..145c36f567 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -223,7 +223,7 @@ $ pg_recvlogical -d postgres --slot=test --drop-slot
      A logical slot will emit each change just once in normal operation.
      The current position of each slot is persisted only at checkpoint, so in
      the case of a crash the slot may return to an earlier LSN, which will
-     then cause recent changes to be resent when the server restarts.
+     then cause recent changes to be re-sent when the server restarts.
      Logical decoding clients are responsible for avoiding ill effects from
      handling the same message more than once.  Clients may wish to record
      the last LSN they saw when decoding and skip over any repeated data or
diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml
index cdb22c54fe..d1d3647f31 100644
--- a/doc/src/sgml/ref/create_subscription.sgml
+++ b/doc/src/sgml/ref/create_subscription.sgml
@@ -160,7 +160,7 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
          <para>
           It is safe to use <literal>off</literal> for logical replication:
           If the subscriber loses transactions because of missing
-          synchronization, the data will be resent from the publisher.
+          synchronization, the data will be re-sent from the publisher.
          </para>
 
          <para>
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index aa9fbd8054..fa2cac5e11 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -1369,7 +1369,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
 			else
 				LWLockRelease(ProcArrayLock);
 
-			/* prevent signal from being resent more than once */
+			/* prevent signal from being re-sent more than once */
 			allow_autovacuum_cancel = false;
 		}
 
-- 
2.17.0

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

On Wed, Sep 09, 2020 at 09:37:42AM -0500, Justin Pryzby wrote:

I've added a few more.

I have done an extra round of review on this patch series, and applied
what looked obvious to me (basically the points already discussed
upthread). Some parts applied down to 9.6 for the docs.
--
Michael

#22Justin Pryzby
pryzby@telsasoft.com
In reply to: Michael Paquier (#21)
15 attachment(s)
Re: doc review for v13

On Thu, Sep 10, 2020 at 03:58:31PM +0900, Michael Paquier wrote:

On Wed, Sep 09, 2020 at 09:37:42AM -0500, Justin Pryzby wrote:

I've added a few more.

I have done an extra round of review on this patch series, and applied
what looked obvious to me (basically the points already discussed
upthread). Some parts applied down to 9.6 for the docs.

Thanks. Here's the remainder, with some new ones.

--
Justin

Attachments:

v9-0001-doc-btree-deduplication.patchtext/x-diff; charset=us-asciiDownload
From ff7662fb2e68257bcffd9f0281220b5d3ab9dfbc Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 30 Mar 2020 19:43:22 -0500
Subject: [PATCH v9 01/15] doc: btree deduplication

commit 0d861bbb702f8aa05c2a4e3f1650e7e8df8c8c27
Author: Peter Geoghegan <pg@bowt.ie>
---
 doc/src/sgml/btree.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/btree.sgml b/doc/src/sgml/btree.sgml
index 20cabe921f..bb395e6a85 100644
--- a/doc/src/sgml/btree.sgml
+++ b/doc/src/sgml/btree.sgml
@@ -642,7 +642,7 @@ options(<replaceable>relopts</replaceable> <type>local_relopts *</type>) returns
   </para>
   <para>
    Deduplication works by periodically merging groups of duplicate
-   tuples together, forming a single posting list tuple for each
+   tuples together, forming a single <firstterm>posting list</firstterm> tuple for each
    group.  The column key value(s) only appear once in this
    representation.  This is followed by a sorted array of
    <acronym>TID</acronym>s that point to rows in the table.  This
-- 
2.17.0

v9-0002-doc-pg_stat_progress_basebackup.patchtext/x-diff; charset=us-asciiDownload
From 9be911f869805b2862154d0170fa89fbd6be9e10 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 29 Mar 2020 21:22:43 -0500
Subject: [PATCH v9 02/15] doc: pg_stat_progress_basebackup

commit e65497df8f85ab9b9084c928ff69f384ea729b24
Author: Fujii Masao <fujii@postgresql.org>
---
 doc/src/sgml/monitoring.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 673a0e73e4..4e0193a967 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -6089,8 +6089,8 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
       <entry><literal>waiting for checkpoint to finish</literal></entry>
       <entry>
        The WAL sender process is currently performing
-       <function>pg_start_backup</function> to set up for
-       taking a base backup, and waiting for backup start
+       <function>pg_start_backup</function> to prepare to
+       take a base backup, and waiting for the start-of-backup
        checkpoint to finish.
       </entry>
      </row>
-- 
2.17.0

v9-0003-doc-Allow-users-to-limit-storage-reserved-by-repl.patchtext/x-diff; charset=us-asciiDownload
From 6500196ffbcc735eccb7623e728788aa3f5494bc Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 7 Apr 2020 19:56:56 -0500
Subject: [PATCH v9 03/15] doc: Allow users to limit storage reserved by
 replication slots

commit c6550776394e25c1620bc8258427c8f1d448080d
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
---
 doc/src/sgml/config.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 2c75876e32..6c1c9157d8 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3902,9 +3902,9 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         slots</link> are allowed to retain in the <filename>pg_wal</filename>
         directory at checkpoint time.
         If <varname>max_slot_wal_keep_size</varname> is -1 (the default),
-        replication slots retain unlimited amount of WAL files.  If
-        restart_lsn of a replication slot gets behind more than that megabytes
-        from the current LSN, the standby using the slot may no longer be able
+        replication slots may retain an unlimited amount of WAL files.  Otherwise, if
+        restart_lsn of a replication slot falls behind the current LSN by more
+        than the given size, the standby using the slot may no longer be able
         to continue replication due to removal of required WAL files. You
         can see the WAL availability of replication slots
         in <link linkend="view-pg-replication-slots">pg_replication_slots</link>.
-- 
2.17.0

v9-0004-doc-s-evade-avoid.patchtext/x-diff; charset=us-asciiDownload
From bf31db4f44e2d379660492a68343a1a65e10cb60 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 6 Apr 2020 17:16:07 -0500
Subject: [PATCH v9 04/15] doc: s/evade/avoid/

---
 src/backend/access/gin/README         | 2 +-
 src/backend/utils/adt/jsonpath_exec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/access/gin/README b/src/backend/access/gin/README
index 125a82219b..41d4e1e8a0 100644
--- a/src/backend/access/gin/README
+++ b/src/backend/access/gin/README
@@ -413,7 +413,7 @@ leftmost leaf of the tree.
 Deletion algorithm keeps exclusive locks on left siblings of pages comprising
 currently investigated path.  Thus, if current page is to be removed, all
 required pages to remove both downlink and rightlink are already locked.  That
-evades potential right to left page locking order, which could deadlock with
+avoids potential right to left page locking order, which could deadlock with
 concurrent stepping right.
 
 A search concurrent to page deletion might already have read a pointer to the
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c
index 2c0b362502..0591c9effc 100644
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -35,7 +35,7 @@
  * executeItemOptUnwrapTarget() function have 'unwrap' argument, which indicates
  * whether unwrapping of array is needed.  When unwrap == true, each of array
  * members is passed to executeItemOptUnwrapTarget() again but with unwrap == false
- * in order to evade subsequent array unwrapping.
+ * in order to avoid subsequent array unwrapping.
  *
  * All boolean expressions (predicates) are evaluated by executeBoolItem()
  * function, which returns tri-state JsonPathBool.  When error is occurred
-- 
2.17.0

v9-0005-doc-Add-logical-replication-support-to-replicate-.patchtext/x-diff; charset=us-asciiDownload
From a43b68cdc4ffe3f33412eab313bfdd942f060183 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 10 Apr 2020 10:05:21 -0500
Subject: [PATCH v9 05/15] doc: Add logical replication support to replicate
 into partitioned tables

commit f1ac27bfda6ce8a399d8001843e9aefff5814f9b
Author: Peter Eisentraut <peter@eisentraut.org>
---
 doc/src/sgml/logical-replication.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index c35415801f..87eac7be58 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -403,7 +403,7 @@
    <listitem>
     <para>
      Replication is only supported by tables, including partitioned tables.
-     Attempts to replicate other types of relations such as views, materialized
+     Attempts to replicate other types of relations, such as views, materialized
      views, or foreign tables, will result in an error.
     </para>
    </listitem>
-- 
2.17.0

v9-0006-doc-backup-manifests.patchtext/x-diff; charset=us-asciiDownload
From e810fc7c0dd23b074a7e37a62e3277db197d549a Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 3 Apr 2020 16:17:28 -0500
Subject: [PATCH v9 06/15] doc: backup manifests

commit 0d8c9c1210c44b36ec2efcb223a1dfbe897a3661
Author: Robert Haas <rhaas@postgresql.org>

Previously reported here:
https://www.postgresql.org/message-id/20200403212445.GB12283%40telsasoft.com
---
 doc/src/sgml/protocol.sgml          | 4 ++--
 doc/src/sgml/ref/pg_basebackup.sgml | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index c3cb7b4255..f5e3318106 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2587,7 +2587,7 @@ The commands accepted in replication mode are:
           and sent along with the backup.  The manifest is a list of every
           file present in the backup with the exception of any WAL files that
           may be included. It also stores the size, last modification time, and
-          an optional checksum for each file.
+          optionally a checksum for each file.
           A value of <literal>force-encode</literal> forces all filenames
           to be hex-encoded; otherwise, this type of encoding is performed only
           for files whose names are non-UTF8 octet sequences.
@@ -2603,7 +2603,7 @@ The commands accepted in replication mode are:
         <term><literal>MANIFEST_CHECKSUMS</literal> <replaceable>checksum_algorithm</replaceable></term>
         <listitem>
          <para>
-          Specifies the algorithm that should be applied to each file included
+          Specifies the checksum algorithm that should be applied to each file included
           in the backup manifest. Currently, the available
           algorithms are <literal>NONE</literal>, <literal>CRC32C</literal>,
           <literal>SHA224</literal>, <literal>SHA256</literal>,
diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index aa0b27c9f3..44e7b2444b 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -368,7 +368,7 @@ PostgreSQL documentation
    </para>
    <para>
     The following command-line options control the generation of the
-    backup and the running of the program:
+    backup and the invocation of the program:
 
     <variablelist>
      <varlistentry>
@@ -540,7 +540,7 @@ PostgreSQL documentation
         of each file for users who wish to verify that the backup has not been
         tampered with, while the CRC32C algorithm provides a checksum that is
         much faster to calculate; it is good at catching errors due to accidental
-        changes but is not resistant to targeted modifications.  Note that, to
+        changes but is not resistant to malicious modifications.  Note that, to
         be useful against an adversary who has access to the backup, the backup
         manifest would need to be stored securely elsewhere or otherwise
         verified not to have been modified since the backup was taken.
-- 
2.17.0

v9-0007-doc-pgbench-cmdline.patchtext/x-diff; charset=us-asciiDownload
From 1292a4efd61ddcdc4d8287fd32f2b68786041f6f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Mon, 31 Aug 2020 08:19:37 -0500
Subject: [PATCH v9 07/15] doc: pgbench cmdline

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

diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml
index 75575b6f06..7180fedd65 100644
--- a/doc/src/sgml/ref/pgbench.sgml
+++ b/doc/src/sgml/ref/pgbench.sgml
@@ -812,8 +812,8 @@ pgbench <optional> <replaceable>options</replaceable> </optional> <replaceable>d
   <title>Common Options</title>
 
    <para>
-    <application>pgbench</application> accepts the following command-line
-    common arguments:
+    <application>pgbench</application> also accepts the following common command-line
+    arguments for connection parameters:
 
     <variablelist>
 
-- 
2.17.0

v9-0008-Say-it-more-naturally.patchtext/x-diff; charset=us-asciiDownload
From d051090e9138f39f69f1dbfca0b93ee6a54d4dc0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 9 Jul 2019 10:42:26 -0500
Subject: [PATCH v9 08/15] Say it more naturally

Originally submitted here and never integrated.
https://www.postgresql.org/message-id/flat/20190427025647.GD3925%40telsasoft.com#e1731c33455145eadc1158042cc411f9

Should backpatch to v12
---
 doc/src/sgml/config.sgml          | 2 +-
 doc/src/sgml/ddl.sgml             | 2 +-
 doc/src/sgml/libpq.sgml           | 2 +-
 doc/src/sgml/ref/alter_table.sgml | 2 +-
 doc/src/sgml/ref/pg_rewind.sgml   | 4 ++--
 doc/src/sgml/ref/reindex.sgml     | 2 +-
 doc/src/sgml/runtime.sgml         | 2 +-
 doc/src/sgml/sources.sgml         | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 6c1c9157d8..3f8bd8a7e8 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3813,7 +3813,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
         servers or streaming base backup clients (i.e., the maximum number of
         simultaneously running WAL sender processes). The default is
         <literal>10</literal>.  The value <literal>0</literal> means
-        replication is disabled.  Abrupt streaming client disconnection might
+        replication is disabled.  Abrupt disconnection of a streaming client might
         leave an orphaned connection slot behind until a timeout is reached,
         so this parameter should be set slightly higher than the maximum
         number of expected clients so disconnected clients can immediately
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 6004dd1def..e890bdd10a 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -3992,7 +3992,7 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02
      Before running the <command>ATTACH PARTITION</command> command, it is
      recommended to create a <literal>CHECK</literal> constraint on the table to
      be attached matching the desired partition constraint. That way,
-     the system will be able to skip the scan to validate the implicit
+     the system will be able to skip the scan which is otherwise needed to validate the implicit
      partition constraint. Without the <literal>CHECK</literal> constraint,
      the table will be scanned to validate the partition constraint while
      holding an <literal>ACCESS EXCLUSIVE</literal> lock on that partition
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index b50391caee..3315f1dd05 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -1227,7 +1227,7 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
       <term><literal>connect_timeout</literal></term>
       <listitem>
       <para>
-       Maximum wait for connection, in seconds (write as a decimal integer,
+       Maximum time to wait while connecting, in seconds (write as a decimal integer,
        e.g., <literal>10</literal>).  Zero, negative, or not specified means
        wait indefinitely.  The minimum allowed timeout is 2 seconds, therefore
        a value of <literal>1</literal> is interpreted as <literal>2</literal>.
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index 35971cd723..ac58cf2a60 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -669,7 +669,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
       When applied to a partitioned table, nothing is moved, but any
       partitions created afterwards with
       <command>CREATE TABLE PARTITION OF</command> will use that tablespace,
-      unless the <literal>TABLESPACE</literal> clause is used to override it.
+      unless overridden by its <literal>TABLESPACE</literal> clause.
      </para>
 
      <para>
diff --git a/doc/src/sgml/ref/pg_rewind.sgml b/doc/src/sgml/ref/pg_rewind.sgml
index ae23badc08..688acdcb06 100644
--- a/doc/src/sgml/ref/pg_rewind.sgml
+++ b/doc/src/sgml/ref/pg_rewind.sgml
@@ -211,7 +211,7 @@ PostgreSQL documentation
         <command>pg_rewind</command> to return without waiting, which is
         faster, but means that a subsequent operating system crash can leave
         the synchronized data directory corrupt.  Generally, this option is
-        useful for testing but should not be used when creating a production
+        useful for testing but should not be used on a production
         installation.
        </para>
       </listitem>
@@ -322,7 +322,7 @@ GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, b
   <para>
    When executing <application>pg_rewind</application> using an online
    cluster as source which has been recently promoted, it is necessary
-   to execute a <command>CHECKPOINT</command> after promotion so as its
+   to execute a <command>CHECKPOINT</command> after promotion such that its
    control file reflects up-to-date timeline information, which is used by
    <application>pg_rewind</application> to check if the target cluster
    can be rewound using the designated source cluster.
diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml
index 33af4ae02a..e2a7e05332 100644
--- a/doc/src/sgml/ref/reindex.sgml
+++ b/doc/src/sgml/ref/reindex.sgml
@@ -252,7 +252,7 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
   <para>
    Reindexing a single index or table requires being the owner of that
    index or table.  Reindexing a schema or database requires being the
-   owner of that schema or database.  Note that is therefore sometimes
+   owner of that schema or database.  Note specifically that it's
    possible for non-superusers to rebuild indexes of tables owned by
    other users.  However, as a special exception, when
    <command>REINDEX DATABASE</command>, <command>REINDEX SCHEMA</command>
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index f584231935..f975406acd 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -2575,7 +2575,7 @@ openssl x509 -req -in server.csr -text -days 365 \
    <para>
     The <productname>PostgreSQL</productname> server will listen for both
     normal and <acronym>GSSAPI</acronym>-encrypted connections on the same TCP
-    port, and will negotiate with any connecting client on whether to
+    port, and will negotiate with any connecting client whether to
     use <acronym>GSSAPI</acronym> for encryption (and for authentication).  By
     default, this decision is up to the client (which means it can be
     downgraded by an attacker); see <xref linkend="auth-pg-hba-conf"/> about
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index d4f73a03c3..38a516080c 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -518,7 +518,7 @@ Hint:       the addendum
    <title>Use of Quotes</title>
 
    <para>
-    Use quotes always to delimit file names, user-supplied identifiers, and
+    Always use quotes to delimit file names, user-supplied identifiers, and
     other variables that might contain words.  Do not use them to mark up
     variables that will not contain words (for example, operator names).
    </para>
-- 
2.17.0

v9-0009-doc-Improve-user-control-over-truncation-of-logge.patchtext/x-diff; charset=us-asciiDownload
From 6d46e62c26a97bb63399a61327caca175d9505fe Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Sep 2020 20:48:46 -0500
Subject: [PATCH v9 09/15] doc: Improve user control over truncation of logged
 bind-parameter values.

0b34e7d307e6a142ee94800e6d5f3e73449eeffd
---
 doc/src/sgml/config.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 3f8bd8a7e8..450ba23d8c 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -6847,9 +6847,9 @@ log_line_prefix = '%m [%p] %q%u@%d/%a '
       </term>
       <listitem>
        <para>
-        If greater than zero, each bind parameter value reported in
-        non-error statement-logging messages is trimmed to this many bytes.
-        Zero disables logging bind parameters with statements.
+        If greater than zero, each bind parameter value logged with a
+        non-error statement-logging message is trimmed to this many bytes.
+        Zero disables logging of bind parameters for non-error statement logs.
         <literal>-1</literal> (the default) allows bind parameters to be
         logged in full.
         If this value is specified without units, it is taken as bytes.
-- 
2.17.0

v9-0010-Fix-docs-time-of-the.patchtext/x-diff; charset=us-asciiDownload
From 1ac66f5f1e814367ea5aca29b83b6cd60f018a2f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sun, 5 Apr 2020 22:35:09 -0500
Subject: [PATCH v9 10/15] Fix docs: "time of the"

commit 9e257a181cc1dc5e19eb5d770ce09cc98f470f5f
Author: Andrew Dunstan <andrew@dunslane.net>
Date:   Sun Mar 24 11:27:20 2013 -0400

    Add parallel pg_dump option.

commit 5ab892c391c6bc54a00e7a8de5cab077cabace6a
Author: Michael Paquier <michael@paquier.xyz>
Date:   Sat Jul 27 22:21:18 2019 +0900

    Add support for --jobs in reindexdb

commit a17923204736d8842eade3517d6a8ee81290fca4
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:   Fri Jan 23 15:02:45 2015 -0300

    vacuumdb: enable parallel mode
---
 doc/src/sgml/ref/pg_dump.sgml   | 2 +-
 doc/src/sgml/ref/reindexdb.sgml | 4 ++--
 doc/src/sgml/ref/vacuumdb.sgml  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index 0ec99165c5..e09ed0a4c3 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -322,7 +322,7 @@ PostgreSQL documentation
       <listitem>
        <para>
         Run the dump in parallel by dumping <replaceable class="parameter">njobs</replaceable>
-        tables simultaneously. This option reduces the time of the dump but it also
+        tables simultaneously. This option may reduce the time needed to perform the dump but it also
         increases the load on the database server. You can only use this option with the
         directory output format because this is the only output format where multiple processes
         can write their data at the same time.
diff --git a/doc/src/sgml/ref/reindexdb.sgml b/doc/src/sgml/ref/reindexdb.sgml
index 026fd018d9..4f821c2095 100644
--- a/doc/src/sgml/ref/reindexdb.sgml
+++ b/doc/src/sgml/ref/reindexdb.sgml
@@ -174,8 +174,8 @@ PostgreSQL documentation
        <para>
         Execute the reindex commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option may reduce the processing time
+        but it also increases the load on the database server.
        </para>
        <para>
         <application>reindexdb</application> will open
diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml
index 95d6894cb0..7b13950552 100644
--- a/doc/src/sgml/ref/vacuumdb.sgml
+++ b/doc/src/sgml/ref/vacuumdb.sgml
@@ -155,8 +155,8 @@ PostgreSQL documentation
        <para>
         Execute the vacuum or analyze commands in parallel by running
         <replaceable class="parameter">njobs</replaceable>
-        commands simultaneously.  This option reduces the time of the
-        processing but it also increases the load on the database server.
+        commands simultaneously.  This option may reduce the processing time
+        but it also increases the load on the database server.
        </para>
        <para>
         <application>vacuumdb</application> will open
-- 
2.17.0

v9-0011-s-periodical-periodic.patchtext/x-diff; charset=us-asciiDownload
From 82980dbf3880cc3865c6ba9e1562ac95d2bb93da Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Sep 2020 18:48:04 -0500
Subject: [PATCH v9 11/15] s/periodical/periodic/

Since 6587818542e79012276dcfedb2f97e3522ee5e9b and 801c2dc72cb3c68a7c430bb244675b7a68fd541a
---
 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 450ba23d8c..b8ad25ae0d 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -8227,7 +8227,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
         set this value anywhere from zero to two billions, <command>VACUUM</command>
         will silently limit the effective value to 95% of
         <xref linkend="guc-autovacuum-freeze-max-age"/>, so that a
-        periodical manual <command>VACUUM</command> has a chance to run before an
+        periodic manual <command>VACUUM</command> has a chance to run before an
         anti-wraparound autovacuum is launched for the table. For more
         information see
         <xref linkend="vacuum-for-wraparound"/>.
@@ -8274,7 +8274,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
         Although users can set this value anywhere from zero to two billions,
         <command>VACUUM</command> will silently limit the effective value to 95% of
         <xref linkend="guc-autovacuum-multixact-freeze-max-age"/>, so that a
-        periodical manual <command>VACUUM</command> has a chance to run before an
+        periodic manual <command>VACUUM</command> has a chance to run before an
         anti-wraparound is launched for the table.
         For more information see <xref linkend="vacuum-for-multixact-wraparound"/>.
        </para>
-- 
2.17.0

v9-0012-Two-billions.patchtext/x-diff; charset=us-asciiDownload
From 7bdddf55268dc656c1b72ebf34fe6d1d44587f69 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Sep 2020 18:49:28 -0500
Subject: [PATCH v9 12/15] Two billions

since: 801c2dc72cb3c68a7c430bb244675b7a68fd541a
---
 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 b8ad25ae0d..8eabf93834 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -8224,7 +8224,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
         a regular <command>VACUUM</command> in that it visits every page that might
         contain unfrozen XIDs or MXIDs, not just those that might contain dead
         tuples.  The default is 150 million transactions.  Although users can
-        set this value anywhere from zero to two billions, <command>VACUUM</command>
+        set this value anywhere from zero to two billion, <command>VACUUM</command>
         will silently limit the effective value to 95% of
         <xref linkend="guc-autovacuum-freeze-max-age"/>, so that a
         periodic manual <command>VACUUM</command> has a chance to run before an
@@ -8271,7 +8271,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
         a regular <command>VACUUM</command> in that it visits every page that might
         contain unfrozen XIDs or MXIDs, not just those that might contain dead
         tuples.  The default is 150 million multixacts.
-        Although users can set this value anywhere from zero to two billions,
+        Although users can set this value anywhere from zero to two billion,
         <command>VACUUM</command> will silently limit the effective value to 95% of
         <xref linkend="guc-autovacuum-multixact-freeze-max-age"/>, so that a
         periodic manual <command>VACUUM</command> has a chance to run before an
-- 
2.17.0

v9-0013-Add-spaces-following-argument.patchtext/x-diff; charset=us-asciiDownload
From 25108802a374f1dec40146083de2312da66dfc00 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Sep 2020 19:12:57 -0500
Subject: [PATCH v9 13/15] Add spaces following argument

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

diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 5d486258ed..461b748d89 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -15626,11 +15626,11 @@ table2-mapping
         <literal>'use_json_null'</literal>.
        </para>
        <para>
-        <literal>jsonb_set_lax('[{"f1":1,"f2":null},2,null,3]', '{0,f1}',null)</literal>
+        <literal>jsonb_set_lax('[{"f1":1,"f2":null},2,null,3]', '{0,f1}', null)</literal>
         <returnvalue>[{"f1":null,"f2":null},2,null,3]</returnvalue>
        </para>
        <para>
-        <literal>jsonb_set_lax('[{"f1":99,"f2":null},2]', '{0,f3}',null, true, 'return_target')</literal>
+        <literal>jsonb_set_lax('[{"f1":99,"f2":null},2]', '{0,f3}', null, true, 'return_target')</literal>
         <returnvalue>[{"f1": 99, "f2": null}, 2]</returnvalue>
        </para></entry>
       </row>
-- 
2.17.0

v9-0014-fix-description-of-stxstattarget-1-behavior.patchtext/x-diff; charset=us-asciiDownload
From b0df450e1c5404515c4d88355a3dc2e200d506d0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Sat, 5 Sep 2020 19:53:53 -0500
Subject: [PATCH v9 14/15] fix description of stxstattarget = -1 behavior

Previously sent
https://www.postgresql.org/message-id/20200906011231.GB6744@telsasoft.com
---
 doc/src/sgml/catalogs.sgml             | 3 ++-
 doc/src/sgml/ref/alter_statistics.sgml | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 7e99928d0c..de9bacd34f 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -7298,7 +7298,8 @@ SCRAM-SHA-256$<replaceable>&lt;iteration count&gt;</replaceable>:<replaceable>&l
        of statistics accumulated for this statistics object by
        <xref linkend="sql-analyze"/>.
        A zero value indicates that no statistics should be collected.
-       A negative value says to use the system default statistics target.
+       A negative value says to use the maximum of the statistics targets of
+       the referenced columns, if set, or the system default statistics target.
        Positive values of <structfield>stxstattarget</structfield>
        determine the target number of <quote>most common values</quote>
        to collect.
diff --git a/doc/src/sgml/ref/alter_statistics.sgml b/doc/src/sgml/ref/alter_statistics.sgml
index 112f5d8924..ac3c18e8af 100644
--- a/doc/src/sgml/ref/alter_statistics.sgml
+++ b/doc/src/sgml/ref/alter_statistics.sgml
@@ -101,7 +101,8 @@ ALTER STATISTICS <replaceable class="parameter">name</replaceable> SET STATISTIC
         The statistic-gathering target for this statistics object for subsequent
         <xref linkend="sql-analyze"/> operations.
         The target can be set in the range 0 to 10000; alternatively, set it
-        to -1 to revert to using the system default statistics
+        to -1 to revert to using the maximum statistics target of the
+        referenced column's, if set, or the system default statistics
         target (<xref linkend="guc-default-statistics-target"/>).
         For more information on the use of statistics by the
         <productname>PostgreSQL</productname> query planner, refer to
-- 
2.17.0

v9-0015-Fix-one-of-our-many-spellings-of-partition.patchtext/x-diff; charset=us-asciiDownload
From da1cf24de0907d3726b0ea43f28b9f90b4ddfaf8 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 15 Sep 2020 10:28:11 -0500
Subject: [PATCH v9 15/15] Fix one of our many spellings of "partition"

---
 src/test/regress/expected/partition_join.out | 2 +-
 src/test/regress/sql/partition_join.sql      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/test/regress/expected/partition_join.out b/src/test/regress/expected/partition_join.out
index 585e724375..0057f41caa 100644
--- a/src/test/regress/expected/partition_join.out
+++ b/src/test/regress/expected/partition_join.out
@@ -4567,7 +4567,7 @@ ANALYZE plt3_adv;
 -- This tests that when merging partitions from plt1_adv and plt2_adv in
 -- merge_list_bounds(), process_outer_partition() returns an already-assigned
 -- merged partition when re-called with plt1_adv_p1 for the second list value
--- '0001' of that partitin
+-- '0001' of that partition
 EXPLAIN (COSTS OFF)
 SELECT t1.a, t1.c, t2.a, t2.c, t3.a, t3.c FROM (plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.c = t2.c)) FULL JOIN plt3_adv t3 ON (t1.c = t3.c) WHERE coalesce(t1.a, 0) % 5 != 3 AND coalesce(t1.a, 0) % 5 != 4 ORDER BY t1.c, t1.a, t2.a, t3.a;
                                           QUERY PLAN                                           
diff --git a/src/test/regress/sql/partition_join.sql b/src/test/regress/sql/partition_join.sql
index 73606c86e5..d97b5b69ff 100644
--- a/src/test/regress/sql/partition_join.sql
+++ b/src/test/regress/sql/partition_join.sql
@@ -1090,7 +1090,7 @@ ANALYZE plt3_adv;
 -- This tests that when merging partitions from plt1_adv and plt2_adv in
 -- merge_list_bounds(), process_outer_partition() returns an already-assigned
 -- merged partition when re-called with plt1_adv_p1 for the second list value
--- '0001' of that partitin
+-- '0001' of that partition
 EXPLAIN (COSTS OFF)
 SELECT t1.a, t1.c, t2.a, t2.c, t3.a, t3.c FROM (plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.c = t2.c)) FULL JOIN plt3_adv t3 ON (t1.c = t3.c) WHERE coalesce(t1.a, 0) % 5 != 3 AND coalesce(t1.a, 0) % 5 != 4 ORDER BY t1.c, t1.a, t2.a, t3.a;
 SELECT t1.a, t1.c, t2.a, t2.c, t3.a, t3.c FROM (plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.c = t2.c)) FULL JOIN plt3_adv t3 ON (t1.c = t3.c) WHERE coalesce(t1.a, 0) % 5 != 3 AND coalesce(t1.a, 0) % 5 != 4 ORDER BY t1.c, t1.a, t2.a, t3.a;
-- 
2.17.0

#23Tom Lane
tgl@sss.pgh.pa.us
In reply to: Justin Pryzby (#22)
Re: doc review for v13

Justin Pryzby <pryzby@telsasoft.com> writes:

Thanks. Here's the remainder, with some new ones.

LGTM. I tweaked one or two places a bit more, and pushed it.

regards, tom lane