Multi-insert related comment in CopyFrom()
Hi,
While working on the “Fast COPY FROM based on batch insert” patch, I
noticed this:
else if (proute != NULL && resultRelInfo->ri_TrigDesc != NULL &&
resultRelInfo->ri_TrigDesc->trig_insert_new_table)
{
/*
* For partitioned tables we can't support multi-inserts when there
* are any statement level insert triggers. It might be possible to
* allow partitioned tables with such triggers in the future, but for
* now, CopyMultiInsertInfoFlush expects that any before row insert
* and statement level insert triggers are on the same relation.
*/
insertMethod = CIM_SINGLE;
}
I think there is a thinko in the comment; “before” should be after.
Patch attached.
Best regards,
Etsuro Fujita
Attachments:
Fix-thinko-in-comment.patchapplication/octet-stream; name=Fix-thinko-in-comment.patchDownload
diff --git a/src/backend/commands/copyfrom.c b/src/backend/commands/copyfrom.c
index e8bb168aea..175aa837f2 100644
--- a/src/backend/commands/copyfrom.c
+++ b/src/backend/commands/copyfrom.c
@@ -732,8 +732,8 @@ CopyFrom(CopyFromState cstate)
* For partitioned tables we can't support multi-inserts when there
* are any statement level insert triggers. It might be possible to
* allow partitioned tables with such triggers in the future, but for
- * now, CopyMultiInsertInfoFlush expects that any before row insert
- * and statement level insert triggers are on the same relation.
+ * now, CopyMultiInsertInfoFlush expects that any after row insert and
+ * statement level insert triggers are on the same relation.
*/
insertMethod = CIM_SINGLE;
}
On Wed, Sep 21, 2022 at 4:39 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
While working on the “Fast COPY FROM based on batch insert” patch, I
noticed this:else if (proute != NULL && resultRelInfo->ri_TrigDesc != NULL &&
resultRelInfo->ri_TrigDesc->trig_insert_new_table)
{
/*
* For partitioned tables we can't support multi-inserts when there
* are any statement level insert triggers. It might be possible to
* allow partitioned tables with such triggers in the future, but for
* now, CopyMultiInsertInfoFlush expects that any before row insert
* and statement level insert triggers are on the same relation.
*/
insertMethod = CIM_SINGLE;
}I think there is a thinko in the comment; “before” should be after.
Patch attached.
Pushed.
Best regards,
Etsuro Fujita