Rebased, with a few additions.
>From 27656ceb05d495300d86df40a1d25b0b454fa18b Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Fri, 8 Jan 2021 13:09:55 -0600 Subject: [PATCH 01/21] doc: pageinspect
d6061f83a166b015657fda8623c704fcb86930e9 backpatch to 9.6? --- doc/src/sgml/pageinspect.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/sgml/pageinspect.sgml b/doc/src/sgml/pageinspect.sgml index c733341984..e29eb0783a 100644 --- a/doc/src/sgml/pageinspect.sgml +++ b/doc/src/sgml/pageinspect.sgml @@ -211,7 +211,7 @@ test=# SELECT tuple_data_split('pg_class'::regclass, t_data, t_infomask, t_infom </para> <para> If <parameter>do_detoast</parameter> is <literal>true</literal>, - attribute that will be detoasted as needed. Default value is + attributes will be detoasted as needed. Default value is <literal>false</literal>. </para> </listitem> -- 2.17.0
>From 53a1075b3eb883971021b642d72c9b2913e7edcb Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Sat, 15 Feb 2020 15:53:34 -0600 Subject: [PATCH 02/21] Update comment obsolete since 69c3936a --- src/backend/executor/nodeAgg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 1d1bf958b6..d80adc519d 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -2070,8 +2070,7 @@ initialize_hash_entry(AggState *aggstate, TupleHashTable hashtable, } /* - * Look up hash entries for the current tuple in all hashed grouping sets, - * returning an array of pergroup pointers suitable for advance_aggregates. + * Look up hash entries for the current tuple in all hashed grouping sets. * * Be aware that lookup_hash_entry can reset the tmpcontext. * -- 2.17.0
>From f7c91eaf6915fcb852321496553b719bab26adf5 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Sat, 5 Dec 2020 22:43:12 -0600 Subject: [PATCH 03/21] pg_restore: "must be specified" and --list This was discussed here, but the idea got lost. https://www.postgresql.org/message-id/flat/20190612170201.GA11881%40alvherre.pgsql#2984347ab074e6f198bd294fa41884df --- src/bin/pg_dump/pg_restore.c | 2 +- src/bin/pg_dump/t/001_basic.pl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index 589b4aed53..f6e6e41329 100644 --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@ -305,7 +305,7 @@ main(int argc, char **argv) /* Complain if neither -f nor -d was specified (except if dumping TOC) */ if (!opts->cparams.dbname && !opts->filename && !opts->tocSummary) { - pg_log_error("one of -d/--dbname and -f/--file must be specified"); + pg_log_error("one of -d/--dbname, -f/--file, or -l/--list must be specified"); exit_nicely(1); } diff --git a/src/bin/pg_dump/t/001_basic.pl b/src/bin/pg_dump/t/001_basic.pl index 083fb3ad08..8280914c2a 100644 --- a/src/bin/pg_dump/t/001_basic.pl +++ b/src/bin/pg_dump/t/001_basic.pl @@ -63,8 +63,8 @@ command_fails_like( command_fails_like( ['pg_restore'], - qr{\Qpg_restore: error: one of -d/--dbname and -f/--file must be specified\E}, - 'pg_restore: error: one of -d/--dbname and -f/--file must be specified'); + qr{\Qpg_restore: error: one of -d/--dbname, -f/--file, or -l/--list must be specified\E}, + 'pg_restore: error: one of -d/--dbname, -f/--file, or -l/--list must be specified'); command_fails_like( [ 'pg_restore', '-s', '-a', '-f -' ], -- 2.17.0
>From 8a046c822fded908660e11495bbaeabc80061513 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Sat, 14 Nov 2020 23:09:21 -0600 Subject: [PATCH 04/21] typos in master --- doc/src/sgml/datatype.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 7c341c8e3f..fe88c2273a 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -639,7 +639,7 @@ NUMERIC <para> The <literal>NaN</literal> (not a number) value is used to represent - undefined calculational results. In general, any operation with + undefined computational results. In general, any operation with a <literal>NaN</literal> input yields another <literal>NaN</literal>. The only exception is when the operation's other inputs are such that the same output would be obtained if the <literal>NaN</literal> were to -- 2.17.0
>From 90dd942ad0edf792e703a6f6fc895fc023841a1f Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Wed, 10 Feb 2021 17:45:07 -0600 Subject: [PATCH 05/21] comment typos --- src/include/lib/simplehash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h index 395be1ca9a..99a03c8f21 100644 --- a/src/include/lib/simplehash.h +++ b/src/include/lib/simplehash.h @@ -626,7 +626,7 @@ restart: uint32 curoptimal; SH_ELEMENT_TYPE *entry = &data[curelem]; - /* any empty bucket can directly be used */ + /* any empty bucket can be used directly */ if (entry->status == SH_STATUS_EMPTY) { tb->members++; -- 2.17.0
>From 90cac9224c930d9ce4a5c52129d1d5153bec4153 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Mon, 18 Jan 2021 14:37:17 -0600 Subject: [PATCH 06/21] One fewer (not one less) --- contrib/pageinspect/heapfuncs.c | 2 +- doc/src/sgml/charset.sgml | 2 +- doc/src/sgml/ref/create_type.sgml | 2 +- doc/src/sgml/rules.sgml | 2 +- src/backend/access/common/heaptuple.c | 4 ++-- src/backend/commands/analyze.c | 2 +- src/backend/utils/adt/jsonpath_exec.c | 2 +- src/backend/utils/adt/selfuncs.c | 2 +- src/backend/utils/cache/catcache.c | 2 +- src/backend/utils/misc/sampling.c | 2 +- src/backend/utils/mmgr/freepage.c | 2 +- src/bin/pgbench/pgbench.c | 2 +- src/include/pg_config_manual.h | 4 ++-- src/interfaces/ecpg/include/sqlda-native.h | 2 +- src/test/regress/expected/geometry.out | 2 +- src/test/regress/sql/geometry.sql | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-) diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c index 9abcee32af..f6760eb31e 100644 --- a/contrib/pageinspect/heapfuncs.c +++ b/contrib/pageinspect/heapfuncs.c @@ -338,7 +338,7 @@ tuple_data_split_internal(Oid relid, char *tupdata, attr = TupleDescAttr(tupdesc, i); /* - * Tuple header can specify less attributes than tuple descriptor as + * Tuple header can specify fewer attributes than tuple descriptor as * ALTER TABLE ADD COLUMN without DEFAULT keyword does not actually * change tuples in pages, so attributes with numbers greater than * (t_infomask2 & HEAP_NATTS_MASK) should be treated as NULL. diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml index cebc09ef91..1b00e543a6 100644 --- a/doc/src/sgml/charset.sgml +++ b/doc/src/sgml/charset.sgml @@ -619,7 +619,7 @@ SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR"; name such as <literal>de_DE</literal> can be considered unique within a given database even though it would not be unique globally. Use of the stripped collation names is recommended, since it will - make one less thing you need to change if you decide to change to + make one fewer thing you need to change if you decide to change to another database encoding. Note however that the <literal>default</literal>, <literal>C</literal>, and <literal>POSIX</literal> collations can be used regardless of the database encoding. diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgml index 0b24a55505..693423e524 100644 --- a/doc/src/sgml/ref/create_type.sgml +++ b/doc/src/sgml/ref/create_type.sgml @@ -867,7 +867,7 @@ CREATE TYPE <replaceable class="parameter">name</replaceable> Before <productname>PostgreSQL</productname> version 8.3, the name of a generated array type was always exactly the element type's name with one underscore character (<literal>_</literal>) prepended. (Type names were - therefore restricted in length to one less character than other names.) + therefore restricted in length to one fewer character than other names.) While this is still usually the case, the array type name may vary from this in case of maximum-length names or collisions with user type names that begin with underscore. Writing code that depends on this convention diff --git a/doc/src/sgml/rules.sgml b/doc/src/sgml/rules.sgml index e81addcfa9..aa172d102b 100644 --- a/doc/src/sgml/rules.sgml +++ b/doc/src/sgml/rules.sgml @@ -1266,7 +1266,7 @@ CREATE [ OR REPLACE ] RULE <replaceable class="parameter">name</replaceable> AS <para> The query trees generated from rule actions are thrown into the rewrite system again, and maybe more rules get applied resulting - in more or less query trees. + in additional or fewer query trees. So a rule's actions must have either a different command type or a different result relation than the rule itself is on, otherwise this recursive process will end up in an infinite loop. diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index 24a27e387d..0b56b0fa5a 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -719,11 +719,11 @@ heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest) } /* - * Expand a tuple which has less attributes than required. For each attribute + * Expand a tuple which has fewer attributes than required. For each attribute * not present in the sourceTuple, if there is a missing value that will be * used. Otherwise the attribute will be set to NULL. * - * The source tuple must have less attributes than the required number. + * The source tuple must have fewer attributes than the required number. * * Only one of targetHeapTuple and targetMinimalTuple may be supplied. The * other argument must be NULL. diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 7295cf0215..64908ac39c 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -1003,7 +1003,7 @@ examine_attribute(Relation onerel, int attnum, Node *index_expr) * As of May 2004 we use a new two-stage method: Stage one selects up * to targrows random blocks (or all blocks, if there aren't so many). * Stage two scans these blocks and uses the Vitter algorithm to create - * a random sample of targrows rows (or less, if there are less in the + * a random sample of targrows rows (or fewer, if there are fewer in the * sample of blocks). The two stages are executed simultaneously: each * block is processed as soon as stage one returns its number and while * the rows are read stage two controls which ones are to be inserted diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c index 4d185c27b4..078aaef539 100644 --- a/src/backend/utils/adt/jsonpath_exec.c +++ b/src/backend/utils/adt/jsonpath_exec.c @@ -263,7 +263,7 @@ static int compareDatetime(Datum val1, Oid typid1, Datum val2, Oid typid2, * implement @? and @@ operators, which in turn are intended to have an * index support. Thus, it's desirable to make it easier to achieve * consistency between index scan results and sequential scan results. - * So, we throw as less errors as possible. Regarding this function, + * So, we throw as few errors as possible. Regarding this function, * such behavior also matches behavior of JSON_EXISTS() clause of * SQL/JSON. Regarding jsonb_path_match(), this function doesn't have * an analogy in SQL/JSON, so we define its behavior on our own. diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 47ca4ddbb5..52314d3aa1 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -645,7 +645,7 @@ scalarineqsel(PlannerInfo *root, Oid operator, bool isgt, bool iseq, /* * The calculation so far gave us a selectivity for the "<=" case. - * We'll have one less tuple for "<" and one additional tuple for + * We'll have one fewer tuple for "<" and one additional tuple for * ">=", the latter of which we'll reverse the selectivity for * below, so we can simply subtract one tuple for both cases. The * cases that need this adjustment can be identified by iseq being diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index fa2b49c676..55c9445898 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -1497,7 +1497,7 @@ GetCatCacheHashValue(CatCache *cache, * It doesn't make any sense to specify all of the cache's key columns * here: since the key is unique, there could be at most one match, so * you ought to use SearchCatCache() instead. Hence this function takes - * one less Datum argument than SearchCatCache() does. + * one fewer Datum argument than SearchCatCache() does. * * The caller must not modify the list object or the pointed-to tuples, * and must call ReleaseCatCacheList() when done with the list. diff --git a/src/backend/utils/misc/sampling.c b/src/backend/utils/misc/sampling.c index 0c327e823f..7348b86682 100644 --- a/src/backend/utils/misc/sampling.c +++ b/src/backend/utils/misc/sampling.c @@ -42,7 +42,7 @@ BlockSampler_Init(BlockSampler bs, BlockNumber nblocks, int samplesize, bs->N = nblocks; /* measured table size */ /* - * If we decide to reduce samplesize for tables that have less or not much + * If we decide to reduce samplesize for tables that have fewer or not much * more than samplesize blocks, here is the place to do it. */ bs->n = samplesize; diff --git a/src/backend/utils/mmgr/freepage.c b/src/backend/utils/mmgr/freepage.c index e4ee1aab97..10a1effb74 100644 --- a/src/backend/utils/mmgr/freepage.c +++ b/src/backend/utils/mmgr/freepage.c @@ -495,7 +495,7 @@ FreePageManagerDump(FreePageManager *fpm) * if we search the parent page for the first key greater than or equal to * the first key on the current page, the downlink to this page will be either * the exact index returned by the search (if the first key decreased) - * or one less (if the first key increased). + * or one fewer (if the first key increased). */ static void FreePageBtreeAdjustAncestorKeys(FreePageManager *fpm, FreePageBtree *btp) diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index a4a3f40048..627a244fb7 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -6458,7 +6458,7 @@ threadRun(void *arg) /* * If advanceConnectionState changed client to finished state, - * that's one less client that remains. + * that's one fewer client that remains. */ if (st->state == CSTATE_FINISHED || st->state == CSTATE_ABORTED) remains--; diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h index 2a12071bad..7413748a71 100644 --- a/src/include/pg_config_manual.h +++ b/src/include/pg_config_manual.h @@ -21,7 +21,7 @@ /* * Maximum length for identifiers (e.g. table names, column names, - * function names). Names actually are limited to one less byte than this, + * function names). Names actually are limited to one fewer byte than this, * because the length must include a trailing zero byte. * * Changing this requires an initdb. @@ -87,7 +87,7 @@ /* * MAXPGPATH: standard size of a pathname buffer in PostgreSQL (hence, - * maximum usable pathname length is one less). + * maximum usable pathname length is one fewer). * * We'd use a standard system header symbol for this, if there weren't * so many to choose from: MAXPATHLEN, MAX_PATH, PATH_MAX are all diff --git a/src/interfaces/ecpg/include/sqlda-native.h b/src/interfaces/ecpg/include/sqlda-native.h index 67d3c7b4e4..9e73f1f1b1 100644 --- a/src/interfaces/ecpg/include/sqlda-native.h +++ b/src/interfaces/ecpg/include/sqlda-native.h @@ -7,7 +7,7 @@ /* * Maximum length for identifiers (e.g. table names, column names, - * function names). Names actually are limited to one less byte than this, + * function names). Names actually are limited to one fewer byte than this, * because the length must include a trailing zero byte. * * This should be at least as much as NAMEDATALEN of the database the diff --git a/src/test/regress/expected/geometry.out b/src/test/regress/expected/geometry.out index 84f7eabb66..9799cfbdbd 100644 --- a/src/test/regress/expected/geometry.out +++ b/src/test/regress/expected/geometry.out @@ -4325,7 +4325,7 @@ SELECT f1, polygon(8, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>'; <(100,1),115> | ((-15,1),(18.6827201635,82.3172798365),(100,116),(181.317279836,82.3172798365),(215,1),(181.317279836,-80.3172798365),(100,-114),(18.6827201635,-80.3172798365)) (6 rows) --- Too less points error +-- Too few points error SELECT f1, polygon(1, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>'; ERROR: must request at least 2 points -- Zero radius error diff --git a/src/test/regress/sql/geometry.sql b/src/test/regress/sql/geometry.sql index 96df0ab05a..b0ab6d03ec 100644 --- a/src/test/regress/sql/geometry.sql +++ b/src/test/regress/sql/geometry.sql @@ -424,7 +424,7 @@ SELECT f1, f1::polygon FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>'; -- To polygon with less points SELECT f1, polygon(8, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>'; --- Too less points error +-- Too few points error SELECT f1, polygon(1, f1) FROM CIRCLE_TBL WHERE f1 >= '<(0,0),1>'; -- Zero radius error -- 2.17.0
>From 908da434f1b3598021002112d29622e3fa9e1ae3 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Wed, 30 Dec 2020 09:39:16 -0600 Subject: [PATCH 07/21] function comment: get_am_name --- src/backend/commands/amcmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/commands/amcmds.c b/src/backend/commands/amcmds.c index eff9535ed0..188109e474 100644 --- a/src/backend/commands/amcmds.c +++ b/src/backend/commands/amcmds.c @@ -186,7 +186,7 @@ get_am_oid(const char *amname, bool missing_ok) } /* - * get_am_name - given an access method OID name and type, look up its name. + * get_am_name - given an access method OID, look up its name. */ char * get_am_name(Oid amOid) -- 2.17.0
>From d7b698bfbc176dc46aeda5202aa717103cfafef1 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Sat, 6 Feb 2021 15:13:37 -0600 Subject: [PATCH 08/21] *an exclusive 3c84046490bed3c22e0873dc6ba492e02b8b9051 --- doc/src/sgml/ref/drop_index.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/sgml/ref/drop_index.sgml b/doc/src/sgml/ref/drop_index.sgml index 85cf23bca2..b6d2c2014f 100644 --- a/doc/src/sgml/ref/drop_index.sgml +++ b/doc/src/sgml/ref/drop_index.sgml @@ -45,7 +45,7 @@ DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] <replaceable class="parameter">name</r <para> Drop the index without locking out concurrent selects, inserts, updates, and deletes on the index's table. A normal <command>DROP INDEX</command> - acquires exclusive lock on the table, blocking other accesses until the + acquires an exclusive lock on the table, blocking other accesses until the index drop can be completed. With this option, the command instead waits until conflicting transactions have completed. </para> -- 2.17.0
>From c416a2935730e27216c4d6389e1ad8bacef0de6b Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Wed, 20 Jan 2021 16:10:49 -0600 Subject: [PATCH 09/21] Doc review for psql \dX ad600bba0422dde4b73fbd61049ff2a3847b068a --- doc/src/sgml/ref/psql-ref.sgml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 13c1edfa4d..d0f397d5ea 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1930,8 +1930,9 @@ testdb=> </para> <para> - The column of the kind of extended stats (e.g. Ndistinct) shows its status. - NULL means that it doesn't exists. "defined" means that it was requested + The status of each kind of extended statistics is shown in a column + named after the "kind" (e.g. Ndistinct). + NULL means that it doesn't exist. "defined" means that it was requested when creating the statistics. You can use pg_stats_ext if you'd like to know whether <link linkend="sql-analyze"> <command>ANALYZE</command></link> was run and statistics are available to the -- 2.17.0
>From 6bc94e1935c97cf3a2df54f4210d454004c70045 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Sun, 17 Jan 2021 10:57:21 -0600 Subject: [PATCH 10/21] doc review for checksum docs cf621d9d84db1e6edaff8ffa26bad93fdce5f830 --- doc/src/sgml/wal.sgml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml index 66de1ee2f8..02f576a1a9 100644 --- a/doc/src/sgml/wal.sgml +++ b/doc/src/sgml/wal.sgml @@ -237,19 +237,19 @@ </indexterm> <para> - Data pages are not checksum protected by default, but this can optionally be - enabled for a cluster. When enabled, each data page will be assigned a - checksum that is updated when the page is written and verified every time - the page is read. Only data pages are protected by checksums, internal data + By default, data pages are not protected by checksums, but this can optionally be + enabled for a cluster. When enabled, each data page will be ASSIGNED a + checksum that is updated when the page is written and verified each time + the page is read. Only data pages are protected by checksums; internal data structures and temporary files are not. </para> <para> - Checksums are normally enabled when the cluster is initialized using <link + Checksums verification is normally ENABLED when the cluster is initialized using <link linkend="app-initdb-data-checksums"><application>initdb</application></link>. They can also be enabled or disabled at a later time as an offline operation. Data checksums are enabled or disabled at the full cluster - level, and cannot be specified individually for databases or tables. + level, and cannot be specified for individual databases or tables. </para> <para> @@ -260,9 +260,9 @@ </para> <para> - When attempting to recover from corrupt data it may be necessary to bypass - the checksum protection in order to recover data. To do this, temporarily - set the configuration parameter <xref linkend="guc-ignore-checksum-failure" />. + When attempting to recover from corrupt data, it may be necessary to bypass + the checksum protection. To do this, temporarily set the configuration + parameter <xref linkend="guc-ignore-checksum-failure" />. </para> <sect2 id="checksums-offline-enable-disable"> -- 2.17.0
>From 8e76b2b6f82f4a03039e130e1f9dae053f5dbf03 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Sat, 30 Jan 2021 18:10:21 -0600 Subject: [PATCH 11/21] duplicate words commit 9c4f5192f69ed16c99e0d079f0b5faebd7bad212 Allow pg_rewind to use a standby server as the source system. commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01 Add tests for tuplesort.c. commit 0a2bc5d61e713e3fe72438f020eea5fcc90b0f0b Move per-agg and per-trans duplicate finding to the planner. commit 623a9ba79bbdd11c5eccb30b8bd5c446130e521c snapshot scalability: cache snapshots using a xact completion counter. commit 2c03216d831160bedd72d45f712601b6f7d03f1c Revamp the WAL record format. --- src/backend/access/transam/xlogutils.c | 3 +-- src/backend/optimizer/prep/prepagg.c | 2 +- src/backend/storage/ipc/procarray.c | 2 +- src/bin/pg_rewind/libpq_source.c | 2 +- src/test/regress/expected/tuplesort.out | 2 +- src/test/regress/sql/tuplesort.sql | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c index e723253297..25d6df1659 100644 --- a/src/backend/access/transam/xlogutils.c +++ b/src/backend/access/transam/xlogutils.c @@ -433,8 +433,7 @@ XLogReadBufferForRedoExtended(XLogReaderState *record, * NB: A redo function should normally not call this directly. To get a page * to modify, use XLogReadBufferForRedoExtended instead. It is important that * all pages modified by a WAL record are registered in the WAL records, or - * they will be invisible to tools that that need to know which pages are - * modified. + * they will be invisible to tools that need to know which pages are modified. */ Buffer XLogReadBufferExtended(RelFileNode rnode, ForkNumber forknum, diff --git a/src/backend/optimizer/prep/prepagg.c b/src/backend/optimizer/prep/prepagg.c index 929a8ea13b..89046f9afb 100644 --- a/src/backend/optimizer/prep/prepagg.c +++ b/src/backend/optimizer/prep/prepagg.c @@ -71,7 +71,7 @@ static Datum GetAggInitVal(Datum textInitVal, Oid transtype); * * Information about the aggregates and transition functions are collected * in the root->agginfos and root->aggtransinfos lists. The 'aggtranstype', - * 'aggno', and 'aggtransno' fields in are filled in in each Aggref. + * 'aggno', and 'aggtransno' fields of each Aggref are filled in. * * NOTE: This modifies the Aggrefs in the input expression in-place! * diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index 4085891237..c1e86fb35c 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -2049,7 +2049,7 @@ GetSnapshotDataReuse(Snapshot snapshot) * holding ProcArrayLock) exclusively). Thus the xactCompletionCount check * ensures we would detect if the snapshot would have changed. * - * As the snapshot contents are the same as it was before, it is is safe + * As the snapshot contents are the same as it was before, it is safe * to re-enter the snapshot's xmin into the PGPROC array. None of the rows * visible under the snapshot could already have been removed (that'd * require the set of running transactions to change) and it fulfills the diff --git a/src/bin/pg_rewind/libpq_source.c b/src/bin/pg_rewind/libpq_source.c index 86d2adcaee..ac794cf4eb 100644 --- a/src/bin/pg_rewind/libpq_source.c +++ b/src/bin/pg_rewind/libpq_source.c @@ -539,7 +539,7 @@ process_queued_fetch_requests(libpq_source *src) chunkoff, rq->path, (int64) rq->offset); /* - * We should not receive receive more data than we requested, or + * We should not receive more data than we requested, or * pg_read_binary_file() messed up. We could receive less, * though, if the file was truncated in the source after we * checked its size. That's OK, there should be a WAL record of diff --git a/src/test/regress/expected/tuplesort.out b/src/test/regress/expected/tuplesort.out index 3fc1998bf2..418f296a3f 100644 --- a/src/test/regress/expected/tuplesort.out +++ b/src/test/regress/expected/tuplesort.out @@ -1,7 +1,7 @@ -- only use parallelism when explicitly intending to do so SET max_parallel_maintenance_workers = 0; SET max_parallel_workers = 0; --- A table with with contents that, when sorted, triggers abbreviated +-- A table with contents that, when sorted, triggers abbreviated -- key aborts. One easy way to achieve that is to use uuids that all -- have the same prefix, as abbreviated keys for uuids just use the -- first sizeof(Datum) bytes. diff --git a/src/test/regress/sql/tuplesort.sql b/src/test/regress/sql/tuplesort.sql index 7d7e02f02a..846484d561 100644 --- a/src/test/regress/sql/tuplesort.sql +++ b/src/test/regress/sql/tuplesort.sql @@ -2,7 +2,7 @@ SET max_parallel_maintenance_workers = 0; SET max_parallel_workers = 0; --- A table with with contents that, when sorted, triggers abbreviated +-- A table with contents that, when sorted, triggers abbreviated -- key aborts. One easy way to achieve that is to use uuids that all -- have the same prefix, as abbreviated keys for uuids just use the -- first sizeof(Datum) bytes. -- 2.17.0
>From 4f3498cebb44c07725e27a517673e720f65cbd0d Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Wed, 3 Feb 2021 00:51:25 -0600 Subject: [PATCH 12/21] doc review: piecemeal construction of partitioned indexes 5efd604ec0a3bdde98fe19d8cada69ab4ef80db3 backpatch to v11 --- doc/src/sgml/ddl.sgml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index 1e9a4625cc..a8cbd45d35 100644 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -3962,8 +3962,8 @@ ALTER TABLE measurement ATTACH PARTITION measurement_y2008m02 As explained above, it is possible to create indexes on partitioned tables so that they are applied automatically to the entire hierarchy. This is very - convenient, as not only will the existing partitions become indexed, but - also any partitions that are created in the future will. One limitation is + convenient, as not only the existing partitions will be indexed, but + so will any partitions that are created in the future. One limitation is that it's not possible to use the <literal>CONCURRENTLY</literal> qualifier when creating such a partitioned index. To avoid long lock times, it is possible to use <command>CREATE INDEX ON ONLY</command> -- 2.17.0
>From 77bb3e5a4147a02a305943af6f74f4749a2314d0 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Sat, 23 Jan 2021 17:17:58 -0600 Subject: [PATCH 13/21] doc review for FDW bulk inserts b663a4136331de6c7364226e3dbf7c88bfee7145 --- doc/src/sgml/fdwhandler.sgml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/src/sgml/fdwhandler.sgml b/doc/src/sgml/fdwhandler.sgml index 2e73d296d2..04bc052ee8 100644 --- a/doc/src/sgml/fdwhandler.sgml +++ b/doc/src/sgml/fdwhandler.sgml @@ -626,7 +626,7 @@ ExecForeignBatchInsert(EState *estate, Insert multiple tuples in bulk into the foreign table. The parameters are the same for <function>ExecForeignInsert</function> except <literal>slots</literal> and <literal>planSlots</literal> contain - multiple tuples and <literal>*numSlots></literal> specifies the number of + multiple tuples and <literal>*numSlots</literal> specifies the number of tuples in those arrays. </para> @@ -655,7 +655,7 @@ ExecForeignBatchInsert(EState *estate, <literal>NULL</literal>, attempts to insert into the foreign table will use <function>ExecForeignInsert</function>. This function is not used if the <command>INSERT</command> has the - <literal>RETURNING></literal> clause. + <literal>RETURNING</literal> clause. </para> <para> @@ -672,9 +672,8 @@ GetForeignModifyBatchSize(ResultRelInfo *rinfo); Report the maximum number of tuples that a single <function>ExecForeignBatchInsert</function> call can handle for - the specified foreign table. That is, The executor passes at most - the number of tuples that this function returns to - <function>ExecForeignBatchInsert</function>. + the specified foreign table. The executor passes at most + the given number of tuples to <function>ExecForeignBatchInsert</function>. <literal>rinfo</literal> is the <structname>ResultRelInfo</structname> struct describing the target foreign table. The FDW is expected to provide a foreign server and/or foreign -- 2.17.0
>From 5e2f8875fdf78459ca2bdf17ffe407374a215973 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Sat, 23 Jan 2021 20:33:10 -0600 Subject: [PATCH 14/21] doc review: logical decode in prepare a271a1b50e9bec07e2ef3a05e38e7285113e4ce6 --- doc/src/sgml/logicaldecoding.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml index cf705ed9cd..b854f2ccfc 100644 --- a/doc/src/sgml/logicaldecoding.sgml +++ b/doc/src/sgml/logicaldecoding.sgml @@ -1214,7 +1214,7 @@ stream_commit_cb(...); <-- commit of the streamed transaction </para> <para> - When a prepared transaction is rollbacked using the + When a prepared transaction is rolled back using the <command>ROLLBACK PREPARED</command>, then the <function>rollback_prepared_cb</function> callback is invoked and when the prepared transaction is committed using <command>COMMIT PREPARED</command>, -- 2.17.0
>From 9f9e1d7f838f988ddf629bb8ceef6d8e97ff714a Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Sat, 23 Jan 2021 21:02:47 -0600 Subject: [PATCH 15/21] doc review for multiranges 6df7a9698bb036610c1e8c6d375e1be38cb26d5f --- doc/src/sgml/extend.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index 6e3d82b85b..ec95b4eb01 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -448,7 +448,7 @@ of <type>anycompatible</type> and <type>anycompatiblenonarray</type> inputs, the array element types of <type>anycompatiblearray</type> inputs, the range subtypes of <type>anycompatiblerange</type> inputs, - and the multirange subtypes of <type>anycompatiablemultirange</type> + and the multirange subtypes of <type>anycompatiblemultirange</type> inputs. If <type>anycompatiblenonarray</type> is present then the common type is required to be a non-array type. Once a common type is identified, arguments in <type>anycompatible</type> -- 2.17.0
>From 402515b2e2e49409618c127a1c804ed831d8dcbd Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Sat, 23 Jan 2021 21:03:37 -0600 Subject: [PATCH 16/21] doc review for logical decoding of prepared xacts 0aa8a01d04c8fe200b7a106878eebc3d0af9105c --- doc/src/sgml/logicaldecoding.sgml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml index b854f2ccfc..71e9f36b8e 100644 --- a/doc/src/sgml/logicaldecoding.sgml +++ b/doc/src/sgml/logicaldecoding.sgml @@ -791,9 +791,9 @@ typedef void (*LogicalDecodeMessageCB) (struct LogicalDecodingContext *ctx, <para> The optional <function>filter_prepare_cb</function> callback is called to determine whether data that is part of the current - two-phase commit transaction should be considered for decode - at this prepare stage or as a regular one-phase transaction at - <command>COMMIT PREPARED</command> time later. To signal that + two-phase commit transaction should be considered for decoding + at this prepare stage or later as a regular one-phase transaction at + <command>COMMIT PREPARED</command> time. To signal that decoding should be skipped, return <literal>true</literal>; <literal>false</literal> otherwise. When the callback is not defined, <literal>false</literal> is assumed (i.e. nothing is @@ -820,11 +820,11 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx The required <function>begin_prepare_cb</function> callback is called whenever the start of a prepared transaction has been decoded. The <parameter>gid</parameter> field, which is part of the - <parameter>txn</parameter> parameter can be used in this callback to - check if the plugin has already received this prepare in which case it + <parameter>txn</parameter> parameter, can be used in this callback to + check if the plugin has already received this PREPARE in which case it can skip the remaining changes of the transaction. This can only happen - if the user restarts the decoding after receiving the prepare for a - transaction but before receiving the commit prepared say because of some + if the user restarts the decoding after receiving the PREPARE for a + transaction but before receiving the COMMIT PREPARED, say because of some error. <programlisting> typedef void (*LogicalDecodeBeginPrepareCB) (struct LogicalDecodingContext *ctx, @@ -842,7 +842,7 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx decoded. The <function>change_cb</function> callback for all modified rows will have been called before this, if there have been any modified rows. The <parameter>gid</parameter> field, which is part of the - <parameter>txn</parameter> parameter can be used in this callback. + <parameter>txn</parameter> parameter, can be used in this callback. <programlisting> typedef void (*LogicalDecodePrepareCB) (struct LogicalDecodingContext *ctx, ReorderBufferTXN *txn, @@ -856,9 +856,9 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx <para> The required <function>commit_prepared_cb</function> callback is called - whenever a transaction commit prepared has been decoded. The + whenever a transaction COMMIT PREPARED has been decoded. The <parameter>gid</parameter> field, which is part of the - <parameter>txn</parameter> parameter can be used in this callback. + <parameter>txn</parameter> parameter, can be used in this callback. <programlisting> typedef void (*LogicalDecodeCommitPreparedCB) (struct LogicalDecodingContext *ctx, ReorderBufferTXN *txn, @@ -872,15 +872,15 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx <para> The required <function>rollback_prepared_cb</function> callback is called - whenever a transaction rollback prepared has been decoded. The + whenever a transaction ROLLBACK PREPARED has been decoded. The <parameter>gid</parameter> field, which is part of the - <parameter>txn</parameter> parameter can be used in this callback. The + <parameter>txn</parameter> parameter, can be used in this callback. The parameters <parameter>prepare_end_lsn</parameter> and <parameter>prepare_time</parameter> can be used to check if the plugin - has received this prepare transaction in which case it can apply the + has received this PREPARE TRANSACTION in which case it can apply the rollback, otherwise, it can skip the rollback operation. The <parameter>gid</parameter> alone is not sufficient because the downstream - node can have prepared transaction with same identifier. + node can have a prepared transaction with same identifier. <programlisting> typedef void (*LogicalDecodeRollbackPreparedCB) (struct LogicalDecodingContext *ctx, ReorderBufferTXN *txn, @@ -1122,7 +1122,7 @@ OutputPluginWrite(ctx, true); the <function>stream_commit_cb</function> callback (or possibly aborted using the <function>stream_abort_cb</function> callback). If two-phase commits are supported, the transaction can be prepared using the - <function>stream_prepare_cb</function> callback, commit prepared using the + <function>stream_prepare_cb</function> callback, COMMIT PREPARED using the <function>commit_prepared_cb</function> callback or aborted using the <function>rollback_prepared_cb</function>. </para> -- 2.17.0
>From a0a58a8da9a4144ad684f095dd2b5f6aa2b8eee4 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Sat, 6 Feb 2021 15:17:51 -0600 Subject: [PATCH 17/21] *an old and "deleted [has] happened" Heikki missed this in 6b387179baab8d0e5da6570678eefbe61f3acc79 --- doc/src/sgml/protocol.sgml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index 3763b4b995..a51f2c9920 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -6928,8 +6928,8 @@ Delete </term> <listitem> <para> - Identifies the following TupleData message as a old tuple. - This field is present if the table in which the delete has + Identifies the following TupleData message as an old tuple. + This field is present if the table in which the delete happened has REPLICA IDENTITY set to FULL. </para> </listitem> -- 2.17.0
>From 8c723d5f0478c6c98af9e7a2fbeb3c79bb095a25 Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Wed, 10 Feb 2021 17:19:51 -0600 Subject: [PATCH 18/21] doc review for pg_stat_progress_create_index ab0dfc961b6a821f23d9c40c723d11380ce195a6 should backpatch to v13 --- doc/src/sgml/monitoring.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 3513e127b7..7509a41ba0 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -5726,7 +5726,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid, </para> <para> When creating an index on a partitioned table, this column is set to - the number of partitions on which the index has been completed. + the number of partitions on which the index has been created. This field is <literal>0</literal> during a <literal>REINDEX</literal>. </para></entry> </row> -- 2.17.0
>From 285ecb5f14e20acf889938be2e4804c26f0e1deb Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Thu, 18 Feb 2021 10:08:27 -0600 Subject: [PATCH 19/21] doc review: Multiple xacts during table sync in logical replication ce0fdbfe9722867b7fad4d3ede9b6a6bfc51fb4e --- doc/src/sgml/logical-replication.sgml | 4 ++-- doc/src/sgml/ref/alter_subscription.sgml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml index d0742f2c52..69a9768504 100644 --- a/doc/src/sgml/logical-replication.sgml +++ b/doc/src/sgml/logical-replication.sgml @@ -490,9 +490,9 @@ any changes that happened during the initial data copy using standard logical replication. During this synchronization phase, the changes are applied and committed in the same order as they happened on the - publisher. Once the synchronization is done, the control of the + publisher. Once synchronization is done, control of the replication of the table is given back to the main apply process where - the replication continues as normal. + replication continues as normal. </para> </sect2> </sect1> diff --git a/doc/src/sgml/ref/alter_subscription.sgml b/doc/src/sgml/ref/alter_subscription.sgml index bcb0acf28d..0adf68ecca 100644 --- a/doc/src/sgml/ref/alter_subscription.sgml +++ b/doc/src/sgml/ref/alter_subscription.sgml @@ -56,7 +56,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO < allocated for the subscription on the remote host are released. If due to network breakdown or some other error, <productname>PostgreSQL</productname> is unable to remove the slots, an ERROR will be reported. To proceed in this - situation, either the user need to retry the operation or disassociate the + situation, the user either needs to retry the operation or disassociate the slot from the subscription and drop the subscription as explained in <xref linkend="sql-dropsubscription"/>. </para> -- 2.17.0
>From e3149e34a5f31563437cb18af55df660aabb9f6b Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Thu, 18 Feb 2021 10:13:15 -0600 Subject: [PATCH 20/21] doc review for VACUUM (PROCESS_TOAST) 7cb3048f38e26b39dd5fd412ed8a4981b6809b35 --- doc/src/sgml/ref/vacuum.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/sgml/ref/vacuum.sgml b/doc/src/sgml/ref/vacuum.sgml index 4bb624979b..cc7e1a8547 100644 --- a/doc/src/sgml/ref/vacuum.sgml +++ b/doc/src/sgml/ref/vacuum.sgml @@ -219,7 +219,7 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ ANALYZE ] [ <replaceable class="paramet corresponding <literal>TOAST</literal> table for each relation, if one exists. This is normally the desired behavior and is the default. Setting this option to false may be useful when it is only necessary to - vacuum the main relation. This option is required when the + vacuum the main relation. This option may not be disabled when the <literal>FULL</literal> option is used. </para> </listitem> -- 2.17.0
>From f25414f2f6237f47bab59f600edcdb74f498c87b Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryz...@telsasoft.com> Date: Thu, 18 Feb 2021 13:04:01 -0600 Subject: [PATCH 21/21] doc review: Add functions to discard cached connections 411ae64997dc3a42d19eda6721c581841ce2cb82 --- doc/src/sgml/postgres-fdw.sgml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/src/sgml/postgres-fdw.sgml b/doc/src/sgml/postgres-fdw.sgml index 8d6abd4c54..07aa25799d 100644 --- a/doc/src/sgml/postgres-fdw.sgml +++ b/doc/src/sgml/postgres-fdw.sgml @@ -553,7 +553,7 @@ postgres=# SELECT postgres_fdw_disconnect('loopback1'); <para> This function discards all the open connections that are established by <filename>postgres_fdw</filename> from the local session to - the foreign servers. If the connections are used in the current local + foreign servers. If the connections are used in the current local transaction, they are not disconnected and warning messages are reported. This function returns <literal>true</literal> if it disconnects at least one connection, otherwise <literal>false</literal>. @@ -585,22 +585,22 @@ postgres=# SELECT postgres_fdw_disconnect_all(); <para> When changing the definition of or removing a foreign server or - a user mapping, the corresponding connections are closed. - But note that if the connections are used in the current local transaction - at that moment, they are kept until the end of the transaction. - Closed connections will be established again when they are necessary - by subsequent queries using a foreign table. + a user mapping, the associated connections are closed. + But note that if any connections are in use in the current local transaction, + they are kept until the end of the transaction. + Closed connections will be re-established when they are necessary + by future queries using a foreign table. </para> <para> Once a connection to a foreign server has been established, - it's usually kept until the local or the corresponding remote + it's usually kept until the local or corresponding remote session exits. To disconnect a connection explicitly, <function>postgres_fdw_disconnect</function> and <function>postgres_fdw_disconnect_all</function> functions - need to be used. For example, these are useful when closing - the connections that are no longer necessary and then preventing them - from consuming the foreign server connections capacity too much. + may be used. For example, these are useful to close + connections that are no longer necessary, thereby releasing + connections on the foreign server. </para> </sect2> -- 2.17.0