Find attached some language fixes.

|/* Do this to ensure we've pumped libpq back to idle state */

I don't know why you mean by "pumped"?

The CopySendEndOfRow "case COPY_CALLBACK:" should have a "break;"

This touches some of the same parts as my "bulk insert" patch:
https://commitfest.postgresql.org/32/2553/

-- 
Justin
>From f7bb368963f5808bc5126f179b78507ca52b9cd2 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryz...@telsasoft.com>
Date: Wed, 24 Feb 2021 02:23:17 -0600
Subject: [PATCH] language fixen

---
 contrib/postgres_fdw/postgres_fdw.c |  4 ++--
 doc/src/sgml/fdwhandler.sgml        | 13 +++++++------
 src/backend/commands/copyfrom.c     |  2 +-
 src/backend/commands/copyto.c       |  4 ++--
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index b55f19b193..a3c394360e 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -2203,7 +2203,7 @@ pgfdw_copy_dest_cb(void *buf, int len)
 
 /*
  * postgresBeginForeignCopy
- *		Begin an COPY operation on a foreign table
+ *		Begin a COPY operation on a foreign table
  */
 static void
 postgresBeginForeignCopy(EState *estate,
@@ -2306,7 +2306,7 @@ postgresExecForeignCopy(ResultRelInfo *resultRelInfo,
 
 /*
  * postgresEndForeignCopy
- *		Finish an COPY operation on a foreign table
+ *		Finish a COPY operation on a foreign table
  */
 static void
 postgresEndForeignCopy(EState *estate, ResultRelInfo *resultRelInfo)
diff --git a/doc/src/sgml/fdwhandler.sgml b/doc/src/sgml/fdwhandler.sgml
index a49c17251f..666148aeb3 100644
--- a/doc/src/sgml/fdwhandler.sgml
+++ b/doc/src/sgml/fdwhandler.sgml
@@ -813,8 +813,9 @@ BeginForeignInsert(ModifyTableState *mtstate,
 
      Begin executing an insert operation on a foreign table.  This routine is
      called right before the first tuple is inserted into the foreign table
-     in both cases when it is the partition chosen for tuple routing and the
-     target specified in a <command>COPY FROM</command> command.  It should
+     target specified in a <command>COPY FROM</command> command, or when
+     the foreign table is the partition chosen for tuple routing of a
+     partitioned table.  It should
      perform any initialization needed prior to the actual insertion.
      Subsequently, <function>ExecForeignInsert</function> or
      <function>ExecForeignBatchInsert</function> will be called for
@@ -1072,12 +1073,12 @@ BeginForeignCopy(EState *estate,
                    ResultRelInfo *rinfo);
 </programlisting>
 
-     Begin executing an copy operation on a foreign table. This routine is
+     Begin executing a copy operation on a foreign table. This routine is
      called right before the first call of <function>ExecForeignCopy</function>
      routine for the foreign table. It should perform any initialization needed
      prior to the actual COPY FROM operation.
      Subsequently, <function>ExecForeignCopy</function> will be called for
-     a bulk of tuples to be copied into the foreign table.
+     a batch of tuples to be copied into the foreign table.
     </para>
 
     <para>
@@ -1101,12 +1102,12 @@ ExecForeignCopy(ResultRelInfo *rinfo,
                   int nslots);
 </programlisting>
 
-     Copy a bulk of tuples into the foreign table.
+     Copy a batch of tuples into the foreign table.
       <literal>rinfo</literal> is the <structname>ResultRelInfo</structname> struct describing
      the target foreign table.
      <literal>slots</literal> contains the tuples to be inserted; it will match the
      row-type definition of the foreign table.
-     <literal>nslots</literal> is a number of tuples in the <literal>slots</literal>
+     <literal>nslots</literal> is the number of tuples in the <literal>slots</literal>
     </para>
 
     <para>
diff --git a/src/backend/commands/copyfrom.c b/src/backend/commands/copyfrom.c
index 7b05da7871..b7c912cc3f 100644
--- a/src/backend/commands/copyfrom.c
+++ b/src/backend/commands/copyfrom.c
@@ -660,7 +660,7 @@ CopyFrom(CopyFromState cstate)
 	resultRelInfo = target_resultRelInfo = makeNode(ResultRelInfo);
 	ExecInitResultRelation(estate, resultRelInfo, 1);
 
-	Assert(target_resultRelInfo->ri_usesMultiInsert == false);
+	Assert(!target_resultRelInfo->ri_usesMultiInsert);
 
 	/*
 	 * It's generally more efficient to prepare a bunch of tuples for
diff --git a/src/backend/commands/copyto.c b/src/backend/commands/copyto.c
index 03c9df5084..2ac1e27acd 100644
--- a/src/backend/commands/copyto.c
+++ b/src/backend/commands/copyto.c
@@ -859,8 +859,8 @@ EndCopyTo(CopyToState cstate)
 
 /*
  * Start COPY TO operation.
- * Separated to the routine to prevent duplicate operations in the case of
- * manual mode, where tuples are copied to the destination one by one, by call of
+ * Separate from the main routine to prevent duplicate operations in
+ * manual mode, where tuples are copied to the destination one by one, by calling
  * the CopyOneRowTo() routine.
  */
 void
-- 
2.17.0

Reply via email to