public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH 11/21] duplicate words
33+ messages / 5 participants
[nested] [flat]

* [PATCH 11/21] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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


--jI8keyz6grp/JLjh
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 11/18] duplicate words
@ 2021-01-31 00:10  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-01-31 00:10 UTC (permalink / raw)

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

commit 4a252996d5fda7662b2afdf329a5c95be0fe3b01
    Add tests for tuplesort.c.

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

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

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

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


--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0012-doc-review-piecemeal-construction-of-partitioned-ind.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 32/32] duplicate words
@ 2021-04-04 18:36  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2021-04-04 18:36 UTC (permalink / raw)

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

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


--4eRLI4hEmsdu6Npr--





^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 14/19] duplicate words
@ 2022-04-06 12:24  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2022-04-06 12:24 UTC (permalink / raw)

3f1ce973467a0d285961bf2f99b11d06e264e2c1n 3500ccc39b0dadd1068a03938e4b8ff562587ccc
---
 src/backend/access/transam/xlogreader.c     | 2 +-
 src/backend/replication/basebackup_server.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c
index a5f1a648d3d..b3e37003ac5 100644
--- a/src/backend/access/transam/xlogreader.c
+++ b/src/backend/access/transam/xlogreader.c
@@ -300,7 +300,7 @@ XLogReleasePreviousRecord(XLogReaderState *state)
 	/* Release the space. */
 	if (unlikely(record->oversized))
 	{
-		/* It's not in the the decode buffer, so free it to release space. */
+		/* It's not in the decode buffer, so free it to release space. */
 		pfree(record);
 	}
 	else
diff --git a/src/backend/replication/basebackup_server.c b/src/backend/replication/basebackup_server.c
index bc16897b33f..33595616894 100644
--- a/src/backend/replication/basebackup_server.c
+++ b/src/backend/replication/basebackup_server.c
@@ -195,7 +195,7 @@ bbsink_server_end_archive(bbsink *sink)
 
 	/*
 	 * We intentionally don't use data_sync_elevel here, because the server
-	 * shouldn't PANIC just because we can't guarantee the the backup has been
+	 * shouldn't PANIC just because we can't guarantee the backup has been
 	 * written down to disk. Running recovery won't fix anything in this case
 	 * anyway.
 	 */
-- 
2.17.1


--8X7/QrJGcKSMr1RN
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0015-f-relpersistence.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* [PATCH 04/10] duplicate words
@ 2023-01-18 04:28  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Justin Pryzby @ 2023-01-18 04:28 UTC (permalink / raw)

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

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


--kjpMrWxdCilgNbo1
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0005-WIP-avoid-whitespace-preceding-following-else.patch"



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* Re: Restrict publishing of partitioned table with a foreign table as partition
@ 2025-01-30 12:02  Shlok Kyal <[email protected]>
  0 siblings, 2 replies; 33+ messages in thread

From: Shlok Kyal @ 2025-01-30 12:02 UTC (permalink / raw)
  To: Sergey Tatarintsev <[email protected]>; +Cc: [email protected]

On Wed, 29 Jan 2025 at 19:21, Sergey Tatarintsev
<[email protected]> wrote:
>
>
> 29.01.2025 12:16, Shlok Kyal пишет:
> > Hi,
> >
> > As part of a discussion in [1], I am starting this thread to address
> > the issue reported for foreign tables.
> >
> > Logical replication of foreign tables is not supported, and we throw
> > an error in this case. But when we create a publication on a
> > partitioned table that has a foreign table as a partition, the initial
> > sync of such a table is successful. We should also throw an error in
> > such cases.
> > With this patch, we will throw an error when we try to create a
> > publication on (or add to an existing publication) a partitioned table
> > with a foreign table as its partition or attach such a table to
> > existing published tables.
> >
> > [1] : https://www.postgresql.org/message-id/CAA4eK1Lhh4SgiYQLNiWSNKGdVSzbd53%3Dsr2tQCKooEphDkUtgw%40mail.g...
> >
> > Thanks and Regards,
> > Shlok Kyal
> Hi!
>
> Thanks for patch.
>
> I reviewed it and made some changes.
>
> 1. we should check foreign tables (not partitioned)
> 2. added checking for foreign table creation
> 3. some little corrections
>
> See attach
>

Hi Sergey,

I have added most of the changes in v2-0002 with small changes except
one change.

@@ -1428,6 +1427,12 @@ check_foreign_tables_in_schema(Oid schemaid)
                     errdetail("foreign table \"%s\" is a partition of
partitioned table \"%s\"",
                               get_rel_name(foreign_tbl_relid), parent_name)));
        }
+       else if (relForm->relkind == RELKIND_FOREIGN_TABLE)
+           ereport(ERROR,
+                   (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+                    errmsg("cannot add relation \"%s\" to publication",
+                           get_rel_name(relForm->oid)),
+                    errdetail_relkind_not_supported(RELKIND_FOREIGN_TABLE)));
    }

We should only throw error when foreign table is part of a partition
table in case of 'FOR TABLES IN SCHEMA' . We should not throw an error
otherwise because in case of 'FOR TABLES IN SCHEMA' foreign tables are
not published by default.

I have added the changes in v3-0001.

Thanks and Regards,
Shlok Kyal


Attachments:

  [application/octet-stream] v3-0001-Restrict-publishing-of-partitioned-table-with-a-f.patch (16.9K, ../../CANhcyEWmD18iRFE_aatDoT3tuUEHG6-__BtUaHktiTR4Rey=vQ@mail.gmail.com/2-v3-0001-Restrict-publishing-of-partitioned-table-with-a-f.patch)
  download | inline diff:
From 349750385cd3df12c02654a91997f48f2abd9832 Mon Sep 17 00:00:00 2001
From: Shlok Kyal <[email protected]>
Date: Wed, 29 Jan 2025 10:18:53 +0530
Subject: [PATCH v3] Restrict publishing of partitioned table with a foreign
 table as partition

Logical replication of foreign table is not supported and we throw an
error in this case. But when create a publication on a partitioned
table that has a foreign table as partition, the initial sync of such
table is successful. We should also throw an error in such cases.
With this patch we will throw an error when we try create a publication
on (or add to existing publication) a partitioned table with foreign
table as its partition. We will also throw an error when we try to
attach such table to existing published tables.
---
 src/backend/catalog/pg_publication.c      | 151 ++++++++++++++++++++++
 src/backend/commands/foreigncmds.c        |  40 ++++++
 src/backend/commands/publicationcmds.c    |   3 +
 src/backend/commands/tablecmds.c          |  44 +++++++
 src/include/catalog/pg_publication.h      |   8 ++
 src/test/regress/expected/publication.out |  39 ++++++
 src/test/regress/sql/publication.sql      |  37 ++++++
 7 files changed, 322 insertions(+)

diff --git a/src/backend/catalog/pg_publication.c b/src/backend/catalog/pg_publication.c
index 41ffd494c8..071b428bc0 100644
--- a/src/backend/catalog/pg_publication.c
+++ b/src/backend/catalog/pg_publication.c
@@ -55,6 +55,8 @@ typedef struct
 static void
 check_publication_add_relation(Relation targetrel)
 {
+	Oid			foreign_tbl_relid;
+
 	/* Must be a regular or partitioned table */
 	if (RelationGetForm(targetrel)->relkind != RELKIND_RELATION &&
 		RelationGetForm(targetrel)->relkind != RELKIND_PARTITIONED_TABLE)
@@ -64,6 +66,19 @@ check_publication_add_relation(Relation targetrel)
 						RelationGetRelationName(targetrel)),
 				 errdetail_relkind_not_supported(RelationGetForm(targetrel)->relkind)));
 
+	/*
+	 * Check if it is a partitioned table and any foreign table is its
+	 * partition
+	 */
+	if (check_partrel_has_foreign_table(RelationGetForm(targetrel), &foreign_tbl_relid))
+		ereport(ERROR,
+				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				 errmsg("cannot add relation \"%s\" to publication",
+						RelationGetRelationName(targetrel)),
+				 errdetail("foreign table \"%s\" is a partition of partitioned table \"%s\"",
+						   get_rel_name(foreign_tbl_relid),
+						   RelationGetRelationName(targetrel))));
+
 	/* Can't be system table */
 	if (IsCatalogRelation(targetrel))
 		ereport(ERROR,
@@ -695,6 +710,9 @@ publication_add_schema(Oid pubid, Oid schemaid, bool if_not_exists)
 
 	check_publication_add_schema(schemaid);
 
+	/* check if schema has any foreign table as partition table */
+	check_foreign_tables_in_schema(schemaid);
+
 	/* Form a tuple */
 	memset(values, 0, sizeof(values));
 	memset(nulls, false, sizeof(nulls));
@@ -1324,3 +1342,136 @@ pg_get_publication_tables(PG_FUNCTION_ARGS)
 
 	SRF_RETURN_DONE(funcctx);
 }
+
+/* Check if a partitioned table has a foreign partition*/
+bool
+check_partrel_has_foreign_table(Form_pg_class relform, Oid *foreign_tbl_relid)
+{
+	bool		has_foreign_tbl = false;
+
+	*foreign_tbl_relid = InvalidOid;
+	if (relform->relkind == RELKIND_PARTITIONED_TABLE)
+	{
+		List	   *relids = NIL;
+
+		relids = GetPubPartitionOptionRelations(relids, PUBLICATION_PART_LEAF,
+												relform->oid);
+
+		foreach_oid(relid, relids)
+		{
+			Relation	rel = table_open(relid, AccessShareLock);
+
+			if (RelationGetForm(rel)->relkind == RELKIND_FOREIGN_TABLE)
+			{
+				has_foreign_tbl = true;
+				*foreign_tbl_relid = relid;
+			}
+
+			table_close(rel, AccessShareLock);
+
+			if (has_foreign_tbl)
+				break;
+		}
+	}
+
+	return has_foreign_tbl;
+}
+
+/* Check if a schema has a partitioned table which has a foreign partition */
+void
+check_foreign_tables_in_schema(Oid schemaid)
+{
+	Relation	classRel;
+	ScanKeyData key[2];
+	TableScanDesc scan;
+	HeapTuple	tuple;
+
+	classRel = table_open(RelationRelationId, AccessShareLock);
+
+	ScanKeyInit(&key[0],
+				Anum_pg_class_relnamespace,
+				BTEqualStrategyNumber, F_OIDEQ,
+				schemaid);
+	ScanKeyInit(&key[1],
+				Anum_pg_class_relkind,
+				BTEqualStrategyNumber, F_CHAREQ,
+				CharGetDatum(RELKIND_PARTITIONED_TABLE));
+
+	scan = table_beginscan_catalog(classRel, 2, key);
+	while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
+	{
+		Form_pg_class relForm = (Form_pg_class) GETSTRUCT(tuple);
+		Oid			foreign_tbl_relid;
+
+		if (check_partrel_has_foreign_table(relForm, &foreign_tbl_relid))
+		{
+			List	   *ancestors = get_partition_ancestors(relForm->oid);
+			Oid			parent_oid = relForm->oid;
+			char	   *parent_name;
+
+			foreach_oid(ancestor, ancestors)
+			{
+				Oid			ancestor_schemaid = get_rel_namespace(ancestor);
+
+				if (ancestor_schemaid == schemaid)
+					parent_oid = ancestor;
+			}
+
+			list_free(ancestors);
+			parent_name = get_rel_name(parent_oid);
+
+			ereport(ERROR,
+					(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+					 errmsg("cannot add relation \"%s\" to publication",
+							parent_name),
+					 errdetail("foreign table \"%s\" is a partition of partitioned table \"%s\"",
+							   get_rel_name(foreign_tbl_relid), parent_name)));
+		}
+	}
+
+	table_endscan(scan);
+	table_close(classRel, AccessShareLock);
+}
+
+/* Check if any foreign table is a partition table */
+void
+check_foreign_tables(void)
+{
+	Relation	classRel;
+	ScanKeyData key[1];
+	TableScanDesc scan;
+	HeapTuple	tuple;
+
+	classRel = table_open(RelationRelationId, AccessShareLock);
+
+	ScanKeyInit(&key[0],
+				Anum_pg_class_relkind,
+				BTEqualStrategyNumber, F_CHAREQ,
+				CharGetDatum(RELKIND_FOREIGN_TABLE));
+
+	scan = table_beginscan_catalog(classRel, 1, key);
+	while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
+	{
+		Form_pg_class relForm = (Form_pg_class) GETSTRUCT(tuple);
+
+		if (relForm->relispartition)
+		{
+			Oid			parent_oid;
+			char	   *parent_name;
+			List	   *ancestors = get_partition_ancestors(relForm->oid);
+
+			parent_oid = llast_oid(ancestors);
+			parent_name = get_rel_name(parent_oid);
+
+			ereport(ERROR,
+					(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+					 errmsg("cannot add relation \"%s\" to publication",
+							parent_name),
+					 errdetail("foreign table \"%s\" is a partition of partitioned table \"%s\"",
+							   NameStr(relForm->relname), parent_name)));
+		}
+	}
+
+	table_endscan(scan);
+	table_close(classRel, AccessShareLock);
+}
diff --git a/src/backend/commands/foreigncmds.c b/src/backend/commands/foreigncmds.c
index c14e038d54..004edd9515 100644
--- a/src/backend/commands/foreigncmds.c
+++ b/src/backend/commands/foreigncmds.c
@@ -21,6 +21,7 @@
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
 #include "catalog/objectaccess.h"
+#include "catalog/partition.h"
 #include "catalog/pg_foreign_data_wrapper.h"
 #include "catalog/pg_foreign_server.h"
 #include "catalog/pg_foreign_table.h"
@@ -1423,6 +1424,45 @@ CreateForeignTable(CreateForeignTableStmt *stmt, Oid relid)
 
 	ftrel = table_open(ForeignTableRelationId, RowExclusiveLock);
 
+	/*
+	 * Check if it is a foreign partition and the partitioned table is
+	 * published
+	 */
+	if (stmt->base.partbound != NULL)
+	{
+		RangeVar   *root = castNode(RangeVar, lfirst(list_head(stmt->base.inhRelations)));
+		Relation	rootrel = table_openrv(root, AccessShareLock);
+
+		if (RelationGetForm(rootrel)->relkind == RELKIND_PARTITIONED_TABLE)
+		{
+			Oid			schemaid = RelationGetNamespace(rootrel);
+			List	   *puboids = GetRelationPublications(rootrel->rd_id);
+			List	   *ancestors;
+
+			puboids = list_concat_unique_oid(puboids, GetAllTablesPublications());
+			puboids = list_concat_unique_oid(puboids, GetSchemaPublications(schemaid));
+			ancestors = get_partition_ancestors(rootrel->rd_id);
+
+			foreach_oid(ancestor, ancestors)
+			{
+				puboids = list_concat_unique_oid(puboids,
+												 GetRelationPublications(ancestor));
+				schemaid = get_rel_namespace(ancestor);
+				puboids = list_concat_unique_oid(puboids,
+												 GetSchemaPublications(schemaid));
+			}
+			list_free(ancestors);
+
+			if (puboids)
+				ereport(ERROR,
+						(errcode(ERRCODE_WRONG_OBJECT_TYPE),
+						 errmsg("cannot create foreign partition \"%s\" as partitioned table \"%s\" is published",
+								get_rel_name(relid),
+								RelationGetRelationName(rootrel))));
+		}
+		table_close(rootrel, AccessShareLock);
+	}
+
 	/*
 	 * For now the owner cannot be specified on create. Use effective user ID.
 	 */
diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c
index 951ffabb65..7258d6c33d 100644
--- a/src/backend/commands/publicationcmds.c
+++ b/src/backend/commands/publicationcmds.c
@@ -855,6 +855,9 @@ CreatePublication(ParseState *pstate, CreatePublicationStmt *stmt)
 	/* Associate objects with the publication. */
 	if (stmt->for_all_tables)
 	{
+		/* Check if any foreign table is a part of partitioned table */
+		check_foreign_tables();
+
 		/* Invalidate relcache so that publication info is rebuilt. */
 		CacheInvalidateRelcacheAll();
 	}
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index d617c4bc63..82e07509a8 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -19222,6 +19222,7 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd,
 	Oid			defaultPartOid;
 	List	   *partBoundConstraint;
 	ParseState *pstate = make_parsestate(NULL);
+	Oid			foreign_tbl_relid;
 
 	pstate->p_sourcetext = context->queryString;
 
@@ -19347,6 +19348,49 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd,
 				(errcode(ERRCODE_WRONG_OBJECT_TYPE),
 				 errmsg("cannot attach temporary relation of another session as partition")));
 
+	/*
+	 * Check if attachrel is a foreign table or a partitioned table with
+	 * foreign partition and rel is not published.
+	 */
+	if (attachrel->rd_rel->relkind == RELKIND_FOREIGN_TABLE ||
+		check_partrel_has_foreign_table(RelationGetForm(attachrel), &foreign_tbl_relid))
+	{
+		Oid			schemaid = RelationGetNamespace(rel);
+		List	   *puboids = GetRelationPublications(rel->rd_id);
+		List	   *ancestors;
+
+		puboids = list_concat_unique_oid(puboids, GetAllTablesPublications());
+		puboids = list_concat_unique_oid(puboids, GetSchemaPublications(schemaid));
+		ancestors = get_partition_ancestors(rel->rd_id);
+
+		foreach_oid(ancestor, ancestors)
+		{
+			puboids = list_concat_unique_oid(puboids,
+											 GetRelationPublications(ancestor));
+			schemaid = get_rel_namespace(ancestor);
+			puboids = list_concat_unique_oid(puboids,
+											 GetSchemaPublications(schemaid));
+		}
+		list_free(ancestors);
+
+		if (puboids)
+		{
+			if (attachrel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
+				ereport(ERROR,
+						(errcode(ERRCODE_WRONG_OBJECT_TYPE),
+						 errmsg("cannot attach a partitioned table with a foreign partition to a published table"),
+						 errdetail("foreign table \"%s\" is a partition of partitioned table \"%s\"",
+								   get_rel_name(foreign_tbl_relid),
+								   RelationGetRelationName(attachrel))));
+			else
+				ereport(ERROR,
+						(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+						 errmsg("cannot attach foreign table \"%s\" to a published table",
+								get_rel_name(attachrel->rd_id))));
+
+		}
+	}
+
 	/*
 	 * Check if attachrel has any identity columns or any columns that aren't
 	 * in the parent.
diff --git a/src/include/catalog/pg_publication.h b/src/include/catalog/pg_publication.h
index 48c7d1a861..ba51f4a721 100644
--- a/src/include/catalog/pg_publication.h
+++ b/src/include/catalog/pg_publication.h
@@ -19,6 +19,7 @@
 
 #include "catalog/genbki.h"
 #include "catalog/objectaddress.h"
+#include "catalog/pg_class.h"
 #include "catalog/pg_publication_d.h"	/* IWYU pragma: export */
 
 /* ----------------
@@ -191,4 +192,11 @@ extern Bitmapset *pub_collist_to_bitmapset(Bitmapset *columns, Datum pubcols,
 extern Bitmapset *pub_form_cols_map(Relation relation,
 									PublishGencolsType include_gencols_type);
 
+extern bool check_partrel_has_foreign_table(Form_pg_class relform,
+											Oid *foreign_tbl_name);
+
+extern void check_foreign_tables_in_schema(Oid schemaid);
+
+extern void check_foreign_tables(void);
+
 #endif							/* PG_PUBLICATION_H */
diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out
index bc3898fbe5..b973f41e94 100644
--- a/src/test/regress/expected/publication.out
+++ b/src/test/regress/expected/publication.out
@@ -1885,6 +1885,45 @@ DROP PUBLICATION pub1;
 DROP PUBLICATION pub2;
 DROP TABLE gencols;
 RESET client_min_messages;
+-- ======================================================
+-- Test when foreign table is a partition of a partitioned table on which
+-- publication is created
+SET client_min_messages = 'ERROR';
+CREATE FOREIGN DATA WRAPPER test_fdw;
+CREATE SERVER fdw_server FOREIGN DATA WRAPPER test_fdw;
+CREATE SCHEMA sch3;
+CREATE TABLE sch3.tmain(id int) PARTITION BY RANGE(id);
+CREATE TABLE sch3.part1 PARTITION OF sch3.tmain FOR VALUES FROM (0) TO (5);
+CREATE TABLE sch3.part2(id int) PARTITION BY RANGE(id);
+CREATE FOREIGN TABLE sch3.part2_1 PARTITION OF sch3.part2 FOR VALUES FROM (5) TO (10) SERVER fdw_server;
+ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part2 FOR VALUES FROM (5) TO (10);
+CREATE PUBLICATION pub1 FOR TABLE sch3.tmain;
+ERROR:  cannot add relation "tmain" to publication
+DETAIL:  foreign table "part2_1" is a partition of partitioned table "tmain"
+CREATE PUBLICATION pub1 FOR TABLES IN SCHEMA sch3;
+ERROR:  cannot add relation "tmain" to publication
+DETAIL:  foreign table "part2_1" is a partition of partitioned table "tmain"
+CREATE PUBLICATION pub1 FOR ALL TABLES;
+ERROR:  cannot add relation "tmain" to publication
+DETAIL:  foreign table "part2_1" is a partition of partitioned table "tmain"
+-- Test when a partitioned table with foreign table as a partition is attached
+-- to partitioned table which is already published
+ALTER TABLE sch3.tmain DETACH PARTITION sch3.part2;
+CREATE PUBLICATION pub1 FOR TABLE sch3.tmain;
+ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part2 FOR VALUES FROM (5) TO (10);
+ERROR:  cannot attach a partitioned table with a foreign partition to a published table
+DETAIL:  foreign table "part2_1" is a partition of partitioned table "part2"
+-- Can't create foreign partition of published table
+CREATE FOREIGN TABLE sch3.part3_1 PARTITION OF sch3.tmain FOR VALUES FROM (10) TO (15) SERVER fdw_server;
+ERROR:  cannot create foreign partition "part3_1" as partitioned table "tmain" is published
+-- Can't attach foreign partition to published table
+CREATE FOREIGN TABLE sch3.part3_2(id int) SERVER fdw_server;
+ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part3_2 FOR VALUES FROM (15) TO (20);
+ERROR:  cannot attach foreign table "part3_2" to a published table
+DROP PUBLICATION pub1;
+DROP SCHEMA sch3 CASCADE;
+DROP SERVER fdw_server;
+DROP FOREIGN DATA WRAPPER test_fdw;
 RESET SESSION AUTHORIZATION;
 DROP ROLE regress_publication_user, regress_publication_user2;
 DROP ROLE regress_publication_user_dummy;
diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql
index 47f0329c24..b9811033dc 100644
--- a/src/test/regress/sql/publication.sql
+++ b/src/test/regress/sql/publication.sql
@@ -1186,6 +1186,43 @@ DROP PUBLICATION pub2;
 DROP TABLE gencols;
 
 RESET client_min_messages;
+-- ======================================================
+
+-- Test when foreign table is a partition of a partitioned table on which
+-- publication is created
+SET client_min_messages = 'ERROR';
+CREATE FOREIGN DATA WRAPPER test_fdw;
+CREATE SERVER fdw_server FOREIGN DATA WRAPPER test_fdw;
+
+CREATE SCHEMA sch3;
+CREATE TABLE sch3.tmain(id int) PARTITION BY RANGE(id);
+CREATE TABLE sch3.part1 PARTITION OF sch3.tmain FOR VALUES FROM (0) TO (5);
+CREATE TABLE sch3.part2(id int) PARTITION BY RANGE(id);
+CREATE FOREIGN TABLE sch3.part2_1 PARTITION OF sch3.part2 FOR VALUES FROM (5) TO (10) SERVER fdw_server;
+ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part2 FOR VALUES FROM (5) TO (10);
+
+CREATE PUBLICATION pub1 FOR TABLE sch3.tmain;
+CREATE PUBLICATION pub1 FOR TABLES IN SCHEMA sch3;
+CREATE PUBLICATION pub1 FOR ALL TABLES;
+
+-- Test when a partitioned table with foreign table as a partition is attached
+-- to partitioned table which is already published
+ALTER TABLE sch3.tmain DETACH PARTITION sch3.part2;
+CREATE PUBLICATION pub1 FOR TABLE sch3.tmain;
+ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part2 FOR VALUES FROM (5) TO (10);
+
+-- Can't create foreign partition of published table
+CREATE FOREIGN TABLE sch3.part3_1 PARTITION OF sch3.tmain FOR VALUES FROM (10) TO (15) SERVER fdw_server;
+
+-- Can't attach foreign partition to published table
+CREATE FOREIGN TABLE sch3.part3_2(id int) SERVER fdw_server;
+ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part3_2 FOR VALUES FROM (15) TO (20);
+
+DROP PUBLICATION pub1;
+DROP SCHEMA sch3 CASCADE;
+DROP SERVER fdw_server;
+DROP FOREIGN DATA WRAPPER test_fdw;
+
 RESET SESSION AUTHORIZATION;
 DROP ROLE regress_publication_user, regress_publication_user2;
 DROP ROLE regress_publication_user_dummy;
-- 
2.34.1



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* Re: Restrict publishing of partitioned table with a foreign table as partition
@ 2025-01-31 05:08  Sergey Tatarintsev <[email protected]>
  parent: Shlok Kyal <[email protected]>
  1 sibling, 1 reply; 33+ messages in thread

From: Sergey Tatarintsev @ 2025-01-31 05:08 UTC (permalink / raw)
  To: Shlok Kyal <[email protected]>; +Cc: [email protected]


30.01.2025 19:02, Shlok Kyal пишет:
> On Wed, 29 Jan 2025 at 19:21, Sergey Tatarintsev
> <[email protected]> wrote:
>>
>> 29.01.2025 12:16, Shlok Kyal пишет:
>>> Hi,
>>>
>>> As part of a discussion in [1], I am starting this thread to address
>>> the issue reported for foreign tables.
>>>
>>> Logical replication of foreign tables is not supported, and we throw
>>> an error in this case. But when we create a publication on a
>>> partitioned table that has a foreign table as a partition, the initial
>>> sync of such a table is successful. We should also throw an error in
>>> such cases.
>>> With this patch, we will throw an error when we try to create a
>>> publication on (or add to an existing publication) a partitioned table
>>> with a foreign table as its partition or attach such a table to
>>> existing published tables.
>>>
>>> [1] : https://www.postgresql.org/message-id/CAA4eK1Lhh4SgiYQLNiWSNKGdVSzbd53%3Dsr2tQCKooEphDkUtgw%40mail.g...
>>>
>>> Thanks and Regards,
>>> Shlok Kyal
>> Hi!
>>
>> Thanks for patch.
>>
>> I reviewed it and made some changes.
>>
>> 1. we should check foreign tables (not partitioned)
>> 2. added checking for foreign table creation
>> 3. some little corrections
>>
>> See attach
>>
> Hi Sergey,
>
> I have added most of the changes in v2-0002 with small changes except
> one change.
>
> @@ -1428,6 +1427,12 @@ check_foreign_tables_in_schema(Oid schemaid)
>                       errdetail("foreign table \"%s\" is a partition of
> partitioned table \"%s\"",
>                                 get_rel_name(foreign_tbl_relid), parent_name)));
>          }
> +       else if (relForm->relkind == RELKIND_FOREIGN_TABLE)
> +           ereport(ERROR,
> +                   (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
> +                    errmsg("cannot add relation \"%s\" to publication",
> +                           get_rel_name(relForm->oid)),
> +                    errdetail_relkind_not_supported(RELKIND_FOREIGN_TABLE)));
>      }
>
> We should only throw error when foreign table is part of a partition
> table in case of 'FOR TABLES IN SCHEMA' . We should not throw an error
> otherwise because in case of 'FOR TABLES IN SCHEMA' foreign tables are
> not published by default.
>
> I have added the changes in v3-0001.
>
> Thanks and Regards,
> Shlok Kyal

Hello!

Ok, but maybe it will be correct to raise an WARNING (or at least LOG) 
that some tables was skipped during publication. What do you think?

And I think we need check tables which was really published in case of 
'FOR ALL TABLES' and 'FOR TABLES IN SCHEMA' in our tests. See attach.

Also it looks strange - we raise an ERROR for partitioned tables 
containing foreign partitions , but just skip foreign tables as itself. 
I think there should be the same behavior in both cases - raise an ERROR 
or skip.



Attachments:

  [text/x-patch] v4-0001-Restrict-publishing-of-partitioned-table-with-a-f.patch (16.9K, ../../[email protected]/2-v4-0001-Restrict-publishing-of-partitioned-table-with-a-f.patch)
  download | inline diff:
From 349750385cd3df12c02654a91997f48f2abd9832 Mon Sep 17 00:00:00 2001
From: Shlok Kyal <[email protected]>
Date: Wed, 29 Jan 2025 10:18:53 +0530
Subject: [PATCH v3] Restrict publishing of partitioned table with a foreign
 table as partition

Logical replication of foreign table is not supported and we throw an
error in this case. But when create a publication on a partitioned
table that has a foreign table as partition, the initial sync of such
table is successful. We should also throw an error in such cases.
With this patch we will throw an error when we try create a publication
on (or add to existing publication) a partitioned table with foreign
table as its partition. We will also throw an error when we try to
attach such table to existing published tables.
---
 src/backend/catalog/pg_publication.c      | 151 ++++++++++++++++++++++
 src/backend/commands/foreigncmds.c        |  40 ++++++
 src/backend/commands/publicationcmds.c    |   3 +
 src/backend/commands/tablecmds.c          |  44 +++++++
 src/include/catalog/pg_publication.h      |   8 ++
 src/test/regress/expected/publication.out |  39 ++++++
 src/test/regress/sql/publication.sql      |  37 ++++++
 7 files changed, 322 insertions(+)

diff --git a/src/backend/catalog/pg_publication.c b/src/backend/catalog/pg_publication.c
index 41ffd494c8..071b428bc0 100644
--- a/src/backend/catalog/pg_publication.c
+++ b/src/backend/catalog/pg_publication.c
@@ -55,6 +55,8 @@ typedef struct
 static void
 check_publication_add_relation(Relation targetrel)
 {
+	Oid			foreign_tbl_relid;
+
 	/* Must be a regular or partitioned table */
 	if (RelationGetForm(targetrel)->relkind != RELKIND_RELATION &&
 		RelationGetForm(targetrel)->relkind != RELKIND_PARTITIONED_TABLE)
@@ -64,6 +66,19 @@ check_publication_add_relation(Relation targetrel)
 						RelationGetRelationName(targetrel)),
 				 errdetail_relkind_not_supported(RelationGetForm(targetrel)->relkind)));
 
+	/*
+	 * Check if it is a partitioned table and any foreign table is its
+	 * partition
+	 */
+	if (check_partrel_has_foreign_table(RelationGetForm(targetrel), &foreign_tbl_relid))
+		ereport(ERROR,
+				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				 errmsg("cannot add relation \"%s\" to publication",
+						RelationGetRelationName(targetrel)),
+				 errdetail("foreign table \"%s\" is a partition of partitioned table \"%s\"",
+						   get_rel_name(foreign_tbl_relid),
+						   RelationGetRelationName(targetrel))));
+
 	/* Can't be system table */
 	if (IsCatalogRelation(targetrel))
 		ereport(ERROR,
@@ -695,6 +710,9 @@ publication_add_schema(Oid pubid, Oid schemaid, bool if_not_exists)
 
 	check_publication_add_schema(schemaid);
 
+	/* check if schema has any foreign table as partition table */
+	check_foreign_tables_in_schema(schemaid);
+
 	/* Form a tuple */
 	memset(values, 0, sizeof(values));
 	memset(nulls, false, sizeof(nulls));
@@ -1324,3 +1342,136 @@ pg_get_publication_tables(PG_FUNCTION_ARGS)
 
 	SRF_RETURN_DONE(funcctx);
 }
+
+/* Check if a partitioned table has a foreign partition*/
+bool
+check_partrel_has_foreign_table(Form_pg_class relform, Oid *foreign_tbl_relid)
+{
+	bool		has_foreign_tbl = false;
+
+	*foreign_tbl_relid = InvalidOid;
+	if (relform->relkind == RELKIND_PARTITIONED_TABLE)
+	{
+		List	   *relids = NIL;
+
+		relids = GetPubPartitionOptionRelations(relids, PUBLICATION_PART_LEAF,
+												relform->oid);
+
+		foreach_oid(relid, relids)
+		{
+			Relation	rel = table_open(relid, AccessShareLock);
+
+			if (RelationGetForm(rel)->relkind == RELKIND_FOREIGN_TABLE)
+			{
+				has_foreign_tbl = true;
+				*foreign_tbl_relid = relid;
+			}
+
+			table_close(rel, AccessShareLock);
+
+			if (has_foreign_tbl)
+				break;
+		}
+	}
+
+	return has_foreign_tbl;
+}
+
+/* Check if a schema has a partitioned table which has a foreign partition */
+void
+check_foreign_tables_in_schema(Oid schemaid)
+{
+	Relation	classRel;
+	ScanKeyData key[2];
+	TableScanDesc scan;
+	HeapTuple	tuple;
+
+	classRel = table_open(RelationRelationId, AccessShareLock);
+
+	ScanKeyInit(&key[0],
+				Anum_pg_class_relnamespace,
+				BTEqualStrategyNumber, F_OIDEQ,
+				schemaid);
+	ScanKeyInit(&key[1],
+				Anum_pg_class_relkind,
+				BTEqualStrategyNumber, F_CHAREQ,
+				CharGetDatum(RELKIND_PARTITIONED_TABLE));
+
+	scan = table_beginscan_catalog(classRel, 2, key);
+	while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
+	{
+		Form_pg_class relForm = (Form_pg_class) GETSTRUCT(tuple);
+		Oid			foreign_tbl_relid;
+
+		if (check_partrel_has_foreign_table(relForm, &foreign_tbl_relid))
+		{
+			List	   *ancestors = get_partition_ancestors(relForm->oid);
+			Oid			parent_oid = relForm->oid;
+			char	   *parent_name;
+
+			foreach_oid(ancestor, ancestors)
+			{
+				Oid			ancestor_schemaid = get_rel_namespace(ancestor);
+
+				if (ancestor_schemaid == schemaid)
+					parent_oid = ancestor;
+			}
+
+			list_free(ancestors);
+			parent_name = get_rel_name(parent_oid);
+
+			ereport(ERROR,
+					(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+					 errmsg("cannot add relation \"%s\" to publication",
+							parent_name),
+					 errdetail("foreign table \"%s\" is a partition of partitioned table \"%s\"",
+							   get_rel_name(foreign_tbl_relid), parent_name)));
+		}
+	}
+
+	table_endscan(scan);
+	table_close(classRel, AccessShareLock);
+}
+
+/* Check if any foreign table is a partition table */
+void
+check_foreign_tables(void)
+{
+	Relation	classRel;
+	ScanKeyData key[1];
+	TableScanDesc scan;
+	HeapTuple	tuple;
+
+	classRel = table_open(RelationRelationId, AccessShareLock);
+
+	ScanKeyInit(&key[0],
+				Anum_pg_class_relkind,
+				BTEqualStrategyNumber, F_CHAREQ,
+				CharGetDatum(RELKIND_FOREIGN_TABLE));
+
+	scan = table_beginscan_catalog(classRel, 1, key);
+	while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
+	{
+		Form_pg_class relForm = (Form_pg_class) GETSTRUCT(tuple);
+
+		if (relForm->relispartition)
+		{
+			Oid			parent_oid;
+			char	   *parent_name;
+			List	   *ancestors = get_partition_ancestors(relForm->oid);
+
+			parent_oid = llast_oid(ancestors);
+			parent_name = get_rel_name(parent_oid);
+
+			ereport(ERROR,
+					(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+					 errmsg("cannot add relation \"%s\" to publication",
+							parent_name),
+					 errdetail("foreign table \"%s\" is a partition of partitioned table \"%s\"",
+							   NameStr(relForm->relname), parent_name)));
+		}
+	}
+
+	table_endscan(scan);
+	table_close(classRel, AccessShareLock);
+}
diff --git a/src/backend/commands/foreigncmds.c b/src/backend/commands/foreigncmds.c
index c14e038d54..004edd9515 100644
--- a/src/backend/commands/foreigncmds.c
+++ b/src/backend/commands/foreigncmds.c
@@ -21,6 +21,7 @@
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
 #include "catalog/objectaccess.h"
+#include "catalog/partition.h"
 #include "catalog/pg_foreign_data_wrapper.h"
 #include "catalog/pg_foreign_server.h"
 #include "catalog/pg_foreign_table.h"
@@ -1423,6 +1424,45 @@ CreateForeignTable(CreateForeignTableStmt *stmt, Oid relid)
 
 	ftrel = table_open(ForeignTableRelationId, RowExclusiveLock);
 
+	/*
+	 * Check if it is a foreign partition and the partitioned table is
+	 * published
+	 */
+	if (stmt->base.partbound != NULL)
+	{
+		RangeVar   *root = castNode(RangeVar, lfirst(list_head(stmt->base.inhRelations)));
+		Relation	rootrel = table_openrv(root, AccessShareLock);
+
+		if (RelationGetForm(rootrel)->relkind == RELKIND_PARTITIONED_TABLE)
+		{
+			Oid			schemaid = RelationGetNamespace(rootrel);
+			List	   *puboids = GetRelationPublications(rootrel->rd_id);
+			List	   *ancestors;
+
+			puboids = list_concat_unique_oid(puboids, GetAllTablesPublications());
+			puboids = list_concat_unique_oid(puboids, GetSchemaPublications(schemaid));
+			ancestors = get_partition_ancestors(rootrel->rd_id);
+
+			foreach_oid(ancestor, ancestors)
+			{
+				puboids = list_concat_unique_oid(puboids,
+												 GetRelationPublications(ancestor));
+				schemaid = get_rel_namespace(ancestor);
+				puboids = list_concat_unique_oid(puboids,
+												 GetSchemaPublications(schemaid));
+			}
+			list_free(ancestors);
+
+			if (puboids)
+				ereport(ERROR,
+						(errcode(ERRCODE_WRONG_OBJECT_TYPE),
+						 errmsg("cannot create foreign partition \"%s\" as partitioned table \"%s\" is published",
+								get_rel_name(relid),
+								RelationGetRelationName(rootrel))));
+		}
+		table_close(rootrel, AccessShareLock);
+	}
+
 	/*
 	 * For now the owner cannot be specified on create. Use effective user ID.
 	 */
diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c
index 951ffabb65..7258d6c33d 100644
--- a/src/backend/commands/publicationcmds.c
+++ b/src/backend/commands/publicationcmds.c
@@ -855,6 +855,9 @@ CreatePublication(ParseState *pstate, CreatePublicationStmt *stmt)
 	/* Associate objects with the publication. */
 	if (stmt->for_all_tables)
 	{
+		/* Check if any foreign table is a part of partitioned table */
+		check_foreign_tables();
+
 		/* Invalidate relcache so that publication info is rebuilt. */
 		CacheInvalidateRelcacheAll();
 	}
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index d617c4bc63..82e07509a8 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -19222,6 +19222,7 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd,
 	Oid			defaultPartOid;
 	List	   *partBoundConstraint;
 	ParseState *pstate = make_parsestate(NULL);
+	Oid			foreign_tbl_relid;
 
 	pstate->p_sourcetext = context->queryString;
 
@@ -19347,6 +19348,49 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd,
 				(errcode(ERRCODE_WRONG_OBJECT_TYPE),
 				 errmsg("cannot attach temporary relation of another session as partition")));
 
+	/*
+	 * Check if attachrel is a foreign table or a partitioned table with
+	 * foreign partition and rel is not published.
+	 */
+	if (attachrel->rd_rel->relkind == RELKIND_FOREIGN_TABLE ||
+		check_partrel_has_foreign_table(RelationGetForm(attachrel), &foreign_tbl_relid))
+	{
+		Oid			schemaid = RelationGetNamespace(rel);
+		List	   *puboids = GetRelationPublications(rel->rd_id);
+		List	   *ancestors;
+
+		puboids = list_concat_unique_oid(puboids, GetAllTablesPublications());
+		puboids = list_concat_unique_oid(puboids, GetSchemaPublications(schemaid));
+		ancestors = get_partition_ancestors(rel->rd_id);
+
+		foreach_oid(ancestor, ancestors)
+		{
+			puboids = list_concat_unique_oid(puboids,
+											 GetRelationPublications(ancestor));
+			schemaid = get_rel_namespace(ancestor);
+			puboids = list_concat_unique_oid(puboids,
+											 GetSchemaPublications(schemaid));
+		}
+		list_free(ancestors);
+
+		if (puboids)
+		{
+			if (attachrel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
+				ereport(ERROR,
+						(errcode(ERRCODE_WRONG_OBJECT_TYPE),
+						 errmsg("cannot attach a partitioned table with a foreign partition to a published table"),
+						 errdetail("foreign table \"%s\" is a partition of partitioned table \"%s\"",
+								   get_rel_name(foreign_tbl_relid),
+								   RelationGetRelationName(attachrel))));
+			else
+				ereport(ERROR,
+						(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+						 errmsg("cannot attach foreign table \"%s\" to a published table",
+								get_rel_name(attachrel->rd_id))));
+
+		}
+	}
+
 	/*
 	 * Check if attachrel has any identity columns or any columns that aren't
 	 * in the parent.
diff --git a/src/include/catalog/pg_publication.h b/src/include/catalog/pg_publication.h
index 48c7d1a861..ba51f4a721 100644
--- a/src/include/catalog/pg_publication.h
+++ b/src/include/catalog/pg_publication.h
@@ -19,6 +19,7 @@
 
 #include "catalog/genbki.h"
 #include "catalog/objectaddress.h"
+#include "catalog/pg_class.h"
 #include "catalog/pg_publication_d.h"	/* IWYU pragma: export */
 
 /* ----------------
@@ -191,4 +192,11 @@ extern Bitmapset *pub_collist_to_bitmapset(Bitmapset *columns, Datum pubcols,
 extern Bitmapset *pub_form_cols_map(Relation relation,
 									PublishGencolsType include_gencols_type);
 
+extern bool check_partrel_has_foreign_table(Form_pg_class relform,
+											Oid *foreign_tbl_name);
+
+extern void check_foreign_tables_in_schema(Oid schemaid);
+
+extern void check_foreign_tables(void);
+
 #endif							/* PG_PUBLICATION_H */
diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out
index bc3898fbe5..b973f41e94 100644
--- a/src/test/regress/expected/publication.out
+++ b/src/test/regress/expected/publication.out
@@ -1885,6 +1885,45 @@ DROP PUBLICATION pub1;
 DROP PUBLICATION pub2;
 DROP TABLE gencols;
 RESET client_min_messages;
+-- ======================================================
+-- Test when foreign table is a partition of a partitioned table on which
+-- publication is created
+SET client_min_messages = 'ERROR';
+CREATE FOREIGN DATA WRAPPER test_fdw;
+CREATE SERVER fdw_server FOREIGN DATA WRAPPER test_fdw;
+CREATE SCHEMA sch3;
+CREATE TABLE sch3.tmain(id int) PARTITION BY RANGE(id);
+CREATE TABLE sch3.part1 PARTITION OF sch3.tmain FOR VALUES FROM (0) TO (5);
+CREATE TABLE sch3.part2(id int) PARTITION BY RANGE(id);
+CREATE FOREIGN TABLE sch3.part2_1 PARTITION OF sch3.part2 FOR VALUES FROM (5) TO (10) SERVER fdw_server;
+ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part2 FOR VALUES FROM (5) TO (10);
+CREATE PUBLICATION pub1 FOR TABLE sch3.tmain;
+ERROR:  cannot add relation "tmain" to publication
+DETAIL:  foreign table "part2_1" is a partition of partitioned table "tmain"
+CREATE PUBLICATION pub1 FOR TABLES IN SCHEMA sch3;
+ERROR:  cannot add relation "tmain" to publication
+DETAIL:  foreign table "part2_1" is a partition of partitioned table "tmain"
+CREATE PUBLICATION pub1 FOR ALL TABLES;
+ERROR:  cannot add relation "tmain" to publication
+DETAIL:  foreign table "part2_1" is a partition of partitioned table "tmain"
+-- Test when a partitioned table with foreign table as a partition is attached
+-- to partitioned table which is already published
+ALTER TABLE sch3.tmain DETACH PARTITION sch3.part2;
+CREATE PUBLICATION pub1 FOR TABLE sch3.tmain;
+ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part2 FOR VALUES FROM (5) TO (10);
+ERROR:  cannot attach a partitioned table with a foreign partition to a published table
+DETAIL:  foreign table "part2_1" is a partition of partitioned table "part2"
+-- Can't create foreign partition of published table
+CREATE FOREIGN TABLE sch3.part3_1 PARTITION OF sch3.tmain FOR VALUES FROM (10) TO (15) SERVER fdw_server;
+ERROR:  cannot create foreign partition "part3_1" as partitioned table "tmain" is published
+-- Can't attach foreign partition to published table
+CREATE FOREIGN TABLE sch3.part3_2(id int) SERVER fdw_server;
+ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part3_2 FOR VALUES FROM (15) TO (20);
+ERROR:  cannot attach foreign table "part3_2" to a published table
+DROP PUBLICATION pub1;
+DROP SCHEMA sch3 CASCADE;
+DROP SERVER fdw_server;
+DROP FOREIGN DATA WRAPPER test_fdw;
 RESET SESSION AUTHORIZATION;
 DROP ROLE regress_publication_user, regress_publication_user2;
 DROP ROLE regress_publication_user_dummy;
diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql
index 47f0329c24..b9811033dc 100644
--- a/src/test/regress/sql/publication.sql
+++ b/src/test/regress/sql/publication.sql
@@ -1186,6 +1186,43 @@ DROP PUBLICATION pub2;
 DROP TABLE gencols;
 
 RESET client_min_messages;
+-- ======================================================
+
+-- Test when foreign table is a partition of a partitioned table on which
+-- publication is created
+SET client_min_messages = 'ERROR';
+CREATE FOREIGN DATA WRAPPER test_fdw;
+CREATE SERVER fdw_server FOREIGN DATA WRAPPER test_fdw;
+
+CREATE SCHEMA sch3;
+CREATE TABLE sch3.tmain(id int) PARTITION BY RANGE(id);
+CREATE TABLE sch3.part1 PARTITION OF sch3.tmain FOR VALUES FROM (0) TO (5);
+CREATE TABLE sch3.part2(id int) PARTITION BY RANGE(id);
+CREATE FOREIGN TABLE sch3.part2_1 PARTITION OF sch3.part2 FOR VALUES FROM (5) TO (10) SERVER fdw_server;
+ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part2 FOR VALUES FROM (5) TO (10);
+
+CREATE PUBLICATION pub1 FOR TABLE sch3.tmain;
+CREATE PUBLICATION pub1 FOR TABLES IN SCHEMA sch3;
+CREATE PUBLICATION pub1 FOR ALL TABLES;
+
+-- Test when a partitioned table with foreign table as a partition is attached
+-- to partitioned table which is already published
+ALTER TABLE sch3.tmain DETACH PARTITION sch3.part2;
+CREATE PUBLICATION pub1 FOR TABLE sch3.tmain;
+ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part2 FOR VALUES FROM (5) TO (10);
+
+-- Can't create foreign partition of published table
+CREATE FOREIGN TABLE sch3.part3_1 PARTITION OF sch3.tmain FOR VALUES FROM (10) TO (15) SERVER fdw_server;
+
+-- Can't attach foreign partition to published table
+CREATE FOREIGN TABLE sch3.part3_2(id int) SERVER fdw_server;
+ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part3_2 FOR VALUES FROM (15) TO (20);
+
+DROP PUBLICATION pub1;
+DROP SCHEMA sch3 CASCADE;
+DROP SERVER fdw_server;
+DROP FOREIGN DATA WRAPPER test_fdw;
+
 RESET SESSION AUTHORIZATION;
 DROP ROLE regress_publication_user, regress_publication_user2;
 DROP ROLE regress_publication_user_dummy;
-- 
2.34.1



  [text/x-patch] v4-0002-Tests-check-tables-which-was-really-published-via-FO.patch (4.4K, ../../[email protected]/3-v4-0002-Tests-check-tables-which-was-really-published-via-FO.patch)
  download | inline diff:
From 8a2a4f94e4c1f35e77179e6de0d4f3f2d1c7cf1f Mon Sep 17 00:00:00 2001
From: Sergey Tatarintsev <[email protected]>
Date: Fri, 31 Jan 2025 11:57:18 +0700
Subject: [PATCH] Tests: check tables which was really published via 'FOR ALL
 TABLES' and 'FOR TABLES IN SCHEMA'

---
 src/backend/catalog/pg_publication.c      |  1 +
 src/test/regress/expected/publication.out | 26 ++++++++++++++++++++++-
 src/test/regress/sql/publication.sql      | 21 ++++++++++++++++--
 3 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/src/backend/catalog/pg_publication.c b/src/backend/catalog/pg_publication.c
index 071b428bc0..b7be142bd0 100644
--- a/src/backend/catalog/pg_publication.c
+++ b/src/backend/catalog/pg_publication.c
@@ -1372,6 +1372,7 @@ check_partrel_has_foreign_table(Form_pg_class relform, Oid *foreign_tbl_relid)
 			if (has_foreign_tbl)
 				break;
 		}
+		list_free(relids);
 	}
 
 	return has_foreign_tbl;
diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out
index b973f41e94..20dfe5c6d0 100644
--- a/src/test/regress/expected/publication.out
+++ b/src/test/regress/expected/publication.out
@@ -1886,6 +1886,11 @@ DROP PUBLICATION pub2;
 DROP TABLE gencols;
 RESET client_min_messages;
 -- ======================================================
+-- We don't want to see previously created tables, so we'll create an empty database
+SELECT current_database() as prev_dbname
+\gset
+CREATE DATABASE publication_test_db;
+\c publication_test_db
 -- Test when foreign table is a partition of a partitioned table on which
 -- publication is created
 SET client_min_messages = 'ERROR';
@@ -1922,8 +1927,27 @@ ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part3_2 FOR VALUES FROM (15) TO (20
 ERROR:  cannot attach foreign table "part3_2" to a published table
 DROP PUBLICATION pub1;
 DROP SCHEMA sch3 CASCADE;
-DROP SERVER fdw_server;
+CREATE SCHEMA sch4;
+CREATE TABLE sch4.ltable(id int) PARTITION BY RANGE(id);
+CREATE TABLE sch4.ltable_part PARTITION OF sch4.ltable FOR VALUES FROM (0) TO (5);
+CREATE FOREIGN TABLE sch4.ftable(id int) SERVER fdw_server;
+CREATE PUBLICATION pub1 FOR TABLES IN SCHEMA sch4;
+CREATE PUBLICATION pub2 FOR TABLES IN SCHEMA sch4 WITH (publish_via_partition_root);
+CREATE PUBLICATION pub3 FOR ALL TABLES;
+SELECT pubname, tablename FROM pg_publication_tables ORDER BY pubname, tablename;
+ pubname |  tablename  
+---------+-------------
+ pub1    | ltable_part
+ pub2    | ltable
+ pub3    | ltable_part
+(3 rows)
+
+DROP PUBLICATION pub1, pub2;
+DROP SCHEMA sch4 CASCADE;
+DROP SERVER fdw_server CASCADE;
 DROP FOREIGN DATA WRAPPER test_fdw;
+\c :prev_dbname
+DROP DATABASE publication_test_db;
 RESET SESSION AUTHORIZATION;
 DROP ROLE regress_publication_user, regress_publication_user2;
 DROP ROLE regress_publication_user_dummy;
diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql
index b9811033dc..b24c1e90c7 100644
--- a/src/test/regress/sql/publication.sql
+++ b/src/test/regress/sql/publication.sql
@@ -1188,6 +1188,11 @@ DROP TABLE gencols;
 RESET client_min_messages;
 -- ======================================================
 
+-- We don't want to see previously created tables, so we'll create an empty database
+SELECT current_database() as prev_dbname
+\gset
+CREATE DATABASE publication_test_db;
+\c publication_test_db
 -- Test when foreign table is a partition of a partitioned table on which
 -- publication is created
 SET client_min_messages = 'ERROR';
@@ -1220,9 +1225,21 @@ ALTER TABLE sch3.tmain ATTACH PARTITION sch3.part3_2 FOR VALUES FROM (15) TO (20
 
 DROP PUBLICATION pub1;
 DROP SCHEMA sch3 CASCADE;
-DROP SERVER fdw_server;
-DROP FOREIGN DATA WRAPPER test_fdw;
 
+CREATE SCHEMA sch4;
+CREATE TABLE sch4.ltable(id int) PARTITION BY RANGE(id);
+CREATE TABLE sch4.ltable_part PARTITION OF sch4.ltable FOR VALUES FROM (0) TO (5);
+CREATE FOREIGN TABLE sch4.ftable(id int) SERVER fdw_server;
+CREATE PUBLICATION pub1 FOR TABLES IN SCHEMA sch4;
+CREATE PUBLICATION pub2 FOR TABLES IN SCHEMA sch4 WITH (publish_via_partition_root);
+CREATE PUBLICATION pub3 FOR ALL TABLES;
+SELECT pubname, tablename FROM pg_publication_tables ORDER BY pubname, tablename;
+DROP PUBLICATION pub1, pub2;
+DROP SCHEMA sch4 CASCADE;
+DROP SERVER fdw_server CASCADE;
+DROP FOREIGN DATA WRAPPER test_fdw;
+\c :prev_dbname
+DROP DATABASE publication_test_db;
 RESET SESSION AUTHORIZATION;
 DROP ROLE regress_publication_user, regress_publication_user2;
 DROP ROLE regress_publication_user_dummy;
-- 
2.43.0



^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* Re: Restrict publishing of partitioned table with a foreign table as partition
@ 2025-02-04 12:46  vignesh C <[email protected]>
  parent: Sergey Tatarintsev <[email protected]>
  0 siblings, 1 reply; 33+ messages in thread

From: vignesh C @ 2025-02-04 12:46 UTC (permalink / raw)
  To: Sergey Tatarintsev <[email protected]>; +Cc: Shlok Kyal <[email protected]>; [email protected]

On Fri, 31 Jan 2025 at 10:38, Sergey Tatarintsev
<[email protected]> wrote:
>
> Ok, but maybe it will be correct to raise an WARNING (or at least LOG)
> that some tables was skipped during publication. What do you think?
>
> And I think we need check tables which was really published in case of
> 'FOR ALL TABLES' and 'FOR TABLES IN SCHEMA' in our tests. See attach.
>
> Also it looks strange - we raise an ERROR for partitioned tables
> containing foreign partitions , but just skip foreign tables as itself.
> I think there should be the same behavior in both cases - raise an ERROR
> or skip.

I believe this behavior is acceptable. We should throw an error for
partitioned tables that contain foreign partitions, as this would
include the data from these foreign tables during the initial sync,
while incremental changes would not be replicated. However, in the
case of foreign tables, neither the initial sync nor the incremental
sync will occur. Additionally, it is documented in [1] that foreign
tables are not supported, so this behavior is in line with the
documentation and is acceptable.

[1] - https://www.postgresql.org/docs/current/logical-replication-restrictions.html

Regards,
Vignesh






^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* Re: Restrict publishing of partitioned table with a foreign table as partition
@ 2025-02-04 13:01  vignesh C <[email protected]>
  parent: Shlok Kyal <[email protected]>
  1 sibling, 1 reply; 33+ messages in thread

From: vignesh C @ 2025-02-04 13:01 UTC (permalink / raw)
  To: Shlok Kyal <[email protected]>; +Cc: Sergey Tatarintsev <[email protected]>; [email protected]

On Thu, 30 Jan 2025 at 17:32, Shlok Kyal <[email protected]> wrote:
>
> @@ -1428,6 +1427,12 @@ check_foreign_tables_in_schema(Oid schemaid)
>                      errdetail("foreign table \"%s\" is a partition of
> partitioned table \"%s\"",
>                                get_rel_name(foreign_tbl_relid), parent_name)));
>         }
> +       else if (relForm->relkind == RELKIND_FOREIGN_TABLE)
> +           ereport(ERROR,
> +                   (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
> +                    errmsg("cannot add relation \"%s\" to publication",
> +                           get_rel_name(relForm->oid)),
> +                    errdetail_relkind_not_supported(RELKIND_FOREIGN_TABLE)));
>     }
>
> We should only throw error when foreign table is part of a partition
> table in case of 'FOR TABLES IN SCHEMA' . We should not throw an error
> otherwise because in case of 'FOR TABLES IN SCHEMA' foreign tables are
> not published by default.
>
> I have added the changes in v3-0001.

In case of all tables publication you have retrieved all the foreign
tables and then checked if any of the foreign tables is a partition of
a partitioned table. In case of all tables in schema publication you
have retrieved all the partitioned tables and then check if it
includes foreign tables. I felt you can keep the all tables in schema
publication also similar to all tables publication(as generally the
number of foreign tables will be lesser than the tables) i.e. retrieve
all the foreign tables and then check if any of the foreign tables is
a partition of a partitioned table.

Regards,
Vignesh






^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* Re: Restrict publishing of partitioned table with a foreign table as partition
@ 2025-02-04 15:51  Álvaro Herrera <[email protected]>
  parent: vignesh C <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Álvaro Herrera @ 2025-02-04 15:51 UTC (permalink / raw)
  To: vignesh C <[email protected]>; +Cc: Sergey Tatarintsev <[email protected]>; Shlok Kyal <[email protected]>; [email protected]

On 2025-Feb-04, vignesh C wrote:

> We should throw an error for partitioned tables that contain foreign
> partitions, as this would include the data from these foreign tables
> during the initial sync, while incremental changes would not be
> replicated.

Hmm, I would support the idea of allowing partitioned tables containing
foreign partitions into publications, where only the tuples in
non-foreign partitions would be transmitted -- both during initial sync
and during replicated DML.  This way, any partitioned tables with mixed
local and foreign partitions would work okay for replication.  If the
subscriber wants the data in the foreign partitions, they can create the
foreign table on the subscription side and all is well.  From a users
POV this is probably the most useful.

Another aspect is the case where you create the publication first and
the foreign table later.  I didn't spot in the proposed patch any code
that would check whether a publication including this schema exists,
which we would have to do if we wanted to be watertight about rejecting
publications with foreign tables.  But I think that would be a bad
direction to go it.

I'd rather have the table-listing code for publications skip any foreign
tables.  For instance, GetPubPartitionOptionRelations() and
PublicationAddTables() should skip tables with relkind RELKIND_FOREIGN.
The sync code should also silently ignore all foreign tables.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"I am amazed at [the pgsql-sql] mailing list for the wonderful support, and
lack of hesitasion in answering a lost soul's question, I just wished the rest
of the mailing list could be like this."                               (Fotis)
              https://postgr.es/m/[email protected]






^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* Re: Restrict publishing of partitioned table with a foreign table as partition
@ 2025-02-10 10:40  vignesh C <[email protected]>
  parent: vignesh C <[email protected]>
  0 siblings, 1 reply; 33+ messages in thread

From: vignesh C @ 2025-02-10 10:40 UTC (permalink / raw)
  To: Shlok Kyal <[email protected]>; +Cc: Sergey Tatarintsev <[email protected]>; [email protected]

On Tue, 4 Feb 2025 at 18:31, vignesh C <[email protected]> wrote:
>
> On Thu, 30 Jan 2025 at 17:32, Shlok Kyal <[email protected]> wrote:
> >
> > @@ -1428,6 +1427,12 @@ check_foreign_tables_in_schema(Oid schemaid)
> >                      errdetail("foreign table \"%s\" is a partition of
> > partitioned table \"%s\"",
> >                                get_rel_name(foreign_tbl_relid), parent_name)));
> >         }
> > +       else if (relForm->relkind == RELKIND_FOREIGN_TABLE)
> > +           ereport(ERROR,
> > +                   (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
> > +                    errmsg("cannot add relation \"%s\" to publication",
> > +                           get_rel_name(relForm->oid)),
> > +                    errdetail_relkind_not_supported(RELKIND_FOREIGN_TABLE)));
> >     }
> >
> > We should only throw error when foreign table is part of a partition
> > table in case of 'FOR TABLES IN SCHEMA' . We should not throw an error
> > otherwise because in case of 'FOR TABLES IN SCHEMA' foreign tables are
> > not published by default.
> >
> > I have added the changes in v3-0001.
>
> In case of all tables publication you have retrieved all the foreign
> tables and then checked if any of the foreign tables is a partition of
> a partitioned table. In case of all tables in schema publication you
> have retrieved all the partitioned tables and then check if it
> includes foreign tables. I felt you can keep the all tables in schema
> publication also similar to all tables publication(as generally the
> number of foreign tables will be lesser than the tables) i.e. retrieve
> all the foreign tables and then check if any of the foreign tables is
> a partition of a partitioned table.

I believe you chose this approach because partitioned tables can have
their partitions as foreign tables in a different schema. As a result,
the current approach works well for the 'TABLES IN SCHEMA' case. It
would be helpful to include a brief comment explaining this reasoning
where you're handling tables in the schema publication.

Regards,
Vignesh






^ permalink  raw  reply  [nested|flat] 33+ messages in thread

* Re: Restrict publishing of partitioned table with a foreign table as partition
@ 2025-02-11 11:26  Shlok Kyal <[email protected]>
  parent: vignesh C <[email protected]>
  0 siblings, 0 replies; 33+ messages in thread

From: Shlok Kyal @ 2025-02-11 11:26 UTC (permalink / raw)
  To: vignesh C <[email protected]>; +Cc: Sergey Tatarintsev <[email protected]>; [email protected]

On Mon, 10 Feb 2025 at 16:11, vignesh C <[email protected]> wrote:
>
> On Tue, 4 Feb 2025 at 18:31, vignesh C <[email protected]> wrote:
> >
> > On Thu, 30 Jan 2025 at 17:32, Shlok Kyal <[email protected]> wrote:
> > >
> > > @@ -1428,6 +1427,12 @@ check_foreign_tables_in_schema(Oid schemaid)
> > >                      errdetail("foreign table \"%s\" is a partition of
> > > partitioned table \"%s\"",
> > >                                get_rel_name(foreign_tbl_relid), parent_name)));
> > >         }
> > > +       else if (relForm->relkind == RELKIND_FOREIGN_TABLE)
> > > +           ereport(ERROR,
> > > +                   (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
> > > +                    errmsg("cannot add relation \"%s\" to publication",
> > > +                           get_rel_name(relForm->oid)),
> > > +                    errdetail_relkind_not_supported(RELKIND_FOREIGN_TABLE)));
> > >     }
> > >
> > > We should only throw error when foreign table is part of a partition
> > > table in case of 'FOR TABLES IN SCHEMA' . We should not throw an error
> > > otherwise because in case of 'FOR TABLES IN SCHEMA' foreign tables are
> > > not published by default.
> > >
> > > I have added the changes in v3-0001.
> >
> > In case of all tables publication you have retrieved all the foreign
> > tables and then checked if any of the foreign tables is a partition of
> > a partitioned table. In case of all tables in schema publication you
> > have retrieved all the partitioned tables and then check if it
> > includes foreign tables. I felt you can keep the all tables in schema
> > publication also similar to all tables publication(as generally the
> > number of foreign tables will be lesser than the tables) i.e. retrieve
> > all the foreign tables and then check if any of the foreign tables is
> > a partition of a partitioned table.
>
> I believe you chose this approach because partitioned tables can have
> their partitions as foreign tables in a different schema. As a result,
> the current approach works well for the 'TABLES IN SCHEMA' case. It
> would be helpful to include a brief comment explaining this reasoning
> where you're handling tables in the schema publication.
>

Correct, I used this approach because partitioned tables can have
their foreign partitions in a different schema. I have added a comment
for the same in the v5 patch [1].

[1]: https://www.postgresql.org/message-id/CANhcyEXxjq9U7BXxCba3Njz%2BeHpNzAsSVY2GzbV%3D8iy5j%3DUAUA%40ma...


Thanks and Regards,
Shlok Kyal






^ permalink  raw  reply  [nested|flat] 33+ messages in thread


end of thread, other threads:[~2025-02-11 11:26 UTC | newest]

Thread overview: 33+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/21] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-01-31 00:10 [PATCH 11/18] duplicate words Justin Pryzby <[email protected]>
2021-04-04 18:36 [PATCH 32/32] duplicate words Justin Pryzby <[email protected]>
2022-04-06 12:24 [PATCH 14/19] duplicate words Justin Pryzby <[email protected]>
2023-01-18 04:28 [PATCH 04/10] duplicate words Justin Pryzby <[email protected]>
2025-01-30 12:02 Re: Restrict publishing of partitioned table with a foreign table as partition Shlok Kyal <[email protected]>
2025-01-31 05:08 ` Re: Restrict publishing of partitioned table with a foreign table as partition Sergey Tatarintsev <[email protected]>
2025-02-04 12:46   ` Re: Restrict publishing of partitioned table with a foreign table as partition vignesh C <[email protected]>
2025-02-04 15:51     ` Re: Restrict publishing of partitioned table with a foreign table as partition Álvaro Herrera <[email protected]>
2025-02-04 13:01 ` Re: Restrict publishing of partitioned table with a foreign table as partition vignesh C <[email protected]>
2025-02-10 10:40   ` Re: Restrict publishing of partitioned table with a foreign table as partition vignesh C <[email protected]>
2025-02-11 11:26     ` Re: Restrict publishing of partitioned table with a foreign table as partition Shlok Kyal <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox