Remove surplus call to table_finish_bulk_insert
authorDavid Rowley
Mon, 1 Jul 2019 15:07:15 +0000 (03:07 +1200)
committerDavid Rowley
Mon, 1 Jul 2019 15:07:15 +0000 (03:07 +1200)
4de60244e added the call to table_finish_bulk_insert to the
CopyMultiInsertBufferCleanup function.  We use a CopyMultiInsertBuffer even
for non-partitioned tables, so having the cleanup do that meant we would
call table_finsh_bulk_insert twice when performing COPY FROM with
a non-partitioned table.

Here we can just remove the direct call in CopyFrom and let
CopyMultiInsertBufferCleanup handle the call instead.

src/backend/commands/copy.c

index c4dfbdacdf34a1e9009959238daf6494a305cbdc..a4eee4c0d745f8e0f4b5ec314698c44402dfbb8b 100644 (file)
@@ -3369,8 +3369,6 @@ CopyFrom(CopyState cstate)
 
    if (insertMethod != CIM_SINGLE)
    {
-       table_finish_bulk_insert(cstate->rel, ti_options);
-
        /* Tear down the multi-insert buffer data */
        CopyMultiInsertInfoCleanup(&multiInsertInfo);
    }