Added a few more.
And rebased on top of dbc60c5593f26dc777a3be032bff4fb4eab1ddd1

-- 
Justin
>From 37b796862eb8c08dbe0d1a6947a8212d1c515491 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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 <akorot...@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

>From 05526ece41acad552697753a156f161a4253c831 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Sun, 29 Mar 2020 21:31:08 -0500
Subject: [PATCH v3 02/20] doc: percent encoding

commit e0ed6817c0ee218a3681920807404603e042ff04
Author: Michael Paquier <mich...@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

>From 290c309de4ce3ac3103cd527406c75165db4c4e0 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Mon, 30 Mar 2020 19:43:22 -0500
Subject: [PATCH v3 03/20] docs: btree deduplication

commit 0d861bbb702f8aa05c2a4e3f1650e7e8df8c8c27
Author: Peter Geoghegan <p...@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

>From d683b732ab33b3d7f3664a870ad52ca78f44041f Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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 <fu...@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

>From 6cf9ba8538ab7a5bc76550f0d237b51b2ccf6a9c Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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 <and...@dunslane.net>
Date:   Sun Mar 24 11:27:20 2013 -0400

    Add parallel pg_dump option.

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

    Add support for --jobs in reindexdb

commit a17923204736d8842eade3517d6a8ee81290fca4
Author: Alvaro Herrera <alvhe...@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

>From 00f1dca124527ff3bd414acc5d1c0cd2cf225913 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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 <fu...@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

>From b301f7004c66ea82fed4ee321050020375dd8905 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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 <alvhe...@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

>From 900e19bcf8e7bab1904e7ffeb4a5f8afc2fa7676 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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

>From 66675f635a1c527814e835229a671583c2c734ee Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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 <alvhe...@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

>From fe65adb6204c13c4ae8864b9f2574fdd722861e7 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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 <pe...@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

>From ed7b6de40d760c88af0b9be596dc516990e1f39d Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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 <pe...@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

>From 9edd65fdee4caef01b4d4341243a8a038074d598 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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 <pe...@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

>From 42d0e6cb2ed2d75d6f213c9cbc1d69fa62840607 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Fri, 3 Apr 2020 16:17:28 -0500
Subject: [PATCH v3 13/20] docs: backup manifests

commit 0d8c9c1210c44b36ec2efcb223a1dfbe897a3661
Author: Robert Haas <rh...@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

>From d5c19b92debc6ed7c5618e0ec1317ce2a0e7ca0b Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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

>From 8b39acdef8979e06bbfa4fb26078877e8273cc15 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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 <pete...@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

>From 36c4b7a41362c875516e467c38791224736e0a73 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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

>From 1152763fd14bdcef593b334235f3c4285b5805ce Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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

>From 85c51fd71286dba3ff3ca8e091f2c3ed04d664b3 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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 <fu...@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

>From 0a1a049855a35b4cd7de3a2d1b3a0773df21d6bd Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@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.von...@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

Reply via email to