Is it necessary to keep am routine finish_bulk_insert? - Mailing list pgsql-hackers

From Zhang Mingli
Subject Is it necessary to keep am routine finish_bulk_insert?
Date
Msg-id 2253fa56-3e1b-47ab-879c-1eb2af6f41f3@Spark
Whole thread Raw
List pgsql-hackers
Hi, 

We got some trouble when using bulk_insert  of COPY FROM around CopyMultiInsertInfoFlush(), the target table is our own access method storage.

The reason is we mistakenly set am routine finish_bulk_insert() to clean some resources or context. We thought it’s used as normal insert_finish and etc,
but COPY will call that multiple times if copy buffer is full.

And I check this am routine of heap am, found that heapam_finish_bulk_insert() has been removed at commit c6b9204.

Current in codes, there is no place to call finish_bulk_insert(), it’s may be used for other am like ours, but also make it easy to cause
unnecessary troubles.

Shall we remove it before we provide an example for developers to avoid that?


Zhang Mingli
www.hashdata.xyz

pgsql-hackers by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Incremental backup from a streaming replication standby fails
Next
From: Jeff Davis
Date:
Subject: Re: tiny step toward threading: reduce dependence on setlocale()