Re: Fast COPY FROM based on batch insert - Mailing list pgsql-hackers

From Andrey Lepikhov
Subject Re: Fast COPY FROM based on batch insert
Date
Msg-id a8d6717a-0c28-9bc5-7a93-eb36f1cb7975@postgrespro.ru
Whole thread Raw
In response to Re: Fast COPY FROM based on batch insert  (Etsuro Fujita <etsuro.fujita@gmail.com>)
Responses Re: Fast COPY FROM based on batch insert  (Etsuro Fujita <etsuro.fujita@gmail.com>)
List pgsql-hackers
On 10/12/22 07:56, Etsuro Fujita wrote:
> On Tue, Oct 11, 2022 at 3:06 PM Andrey Lepikhov
> <a.lepikhov@postgrespro.ru> wrote:
>> I reviewed the patch one more time. Only one question: bistate and
>> ri_FdwRoutine are strongly bounded. Maybe to add some assertion on
>> (ri_FdwRoutine XOR bistate) ? Just to prevent possible errors in future.
> 
> You mean the bistate member of CopyMultiInsertBuffer?
Yes
> 
> We do not use that member at all for foreign tables, so the patch
> avoids initializing that member in CopyMultiInsertBufferInit() when
> called for a foreign table.  So we have bistate = NULL for foreign
> tables (and bistate != NULL for plain tables), as you mentioned above.
> I think it is a good idea to add such assertions.  How about adding
> them to CopyMultiInsertBufferFlush() and
> CopyMultiInsertBufferCleanup() like the attached?  In the attached I
> updated comments a bit further as well.
Yes, quite enough.

-- 
Regards
Andrey Lepikhov
Postgres Professional




pgsql-hackers by date:

Previous
From: "kuroda.hayato@fujitsu.com"
Date:
Subject: Add mssing test to test_decoding/meson.build
Next
From: Amit Kapila
Date:
Subject: Re: Perform streaming logical transactions by background workers and parallel apply