From: Justin Pryzby <pryzby@telsasoft.com>
To: tsunakawa.takay@fujitsu.com <tsunakawa.takay@fujitsu.com>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Cc: tanghy.fnst@cn.fujitsu.com, Alexey Kondratov <a.kondratov@postgrespro.ru>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Ashutosh Bapat <ashutosh.bapat@2ndquadrant.com>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: PostgreSQL-Dev <pgsql-hackers@postgresql.org>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: houzj.fnst@cn.fujitsu.com
Subject: Re: [POC] Fast COPY FROM command for the table with foreign partitions
Date: Wed, 3 Mar 2021 14:27:03 -0600
Message-ID: <20210303202703.GI29832@telsasoft.com> (raw)
In-Reply-To: <TYAPR01MB2990D36AFD7A7AA70A81F116FE879@TYAPR01MB2990.jpnprd01.prod.outlook.com>
References: <6160196a-88a4-ded8-1047-cec16537a111@postgrespro.ru>
<d4d502d42ded45acb3b070a94552a962@G08CNEXMBPEKD05.g08.fujitsu.local>
<TYAPR01MB29906DF706E88C5B2E574477FEB59@TYAPR01MB2990.jpnprd01.prod.outlook.com>
<95b3e446-92ec-f01f-2035-5f5509e6e016@postgrespro.ru>
<TYAPR01MB29906738B11565E139F0984AFEB59@TYAPR01MB2990.jpnprd01.prod.outlook.com>
<TYAPR01MB29908A830017784F6E8A468FFE8E9@TYAPR01MB2990.jpnprd01.prod.outlook.com>
<20210214210338.GN1793@telsasoft.com>
<TYAPR01MB299041DF2955DDA57CED9A46FE889@TYAPR01MB2990.jpnprd01.prod.outlook.com>
<CA+HiwqHzM=U74RPYJbG3g8RQGxCtQCHzc2h_GQs=uLRytD962w@mail.gmail.com>
<TYAPR01MB2990D36AFD7A7AA70A81F116FE879@TYAPR01MB2990.jpnprd01.prod.outlook.com>
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
Attachments:0001-language-fixen.pxtch (text/x-diff, 4.6K) download
From f7bb368963f5808bc5126f179b78507ca52b9cd2 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@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.cindex 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.sgmlindex 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.cindex 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.cindex 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 instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: pryzby@telsasoft.com, tsunakawa.takay@fujitsu.com, amitlangote09@gmail.com, a.lepikhov@postgrespro.ru, a.kondratov@postgrespro.ru, michael@paquier.xyz, ashutosh.bapat@2ndquadrant.com, ashutosh.bapat.oss@gmail.com, etsuro.fujita@gmail.com, tomas.vondra@enterprisedb.com, houzj.fnst@cn.fujitsu.com
Subject: Re: [POC] Fast COPY FROM command for the table with foreign partitions
In-Reply-To: <20210303202703.GI29832@telsasoft.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox