Is it necessary to keep am routine finish_bulk_insert?

From: Zhang Mingli <zmlpostgres(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Is it necessary to keep am routine finish_bulk_insert?
Date: 2024-07-26 06:02:05
Message-ID: 2253fa56-3e1b-47ab-879c-1eb2af6f41f3@Spark
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2024-07-26 06:07:37 Re: tiny step toward threading: reduce dependence on setlocale()
Previous Message Laurenz Albe 2024-07-26 05:09:29 Re: Incremental backup from a streaming replication standby fails