Review observations for COPY ON_ERROR_TABLE patch

From: vellaipandiyan sm <vellaipandiyan(dot)sm(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Review observations for COPY ON_ERROR_TABLE patch
Date: 2026-05-18 06:55:43
Message-ID: CAGXjcjmTMkYCHDsj6PtLyoCzZGu5gpGy7XkQCamaqGnvc52N9A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello hackers,

I was reviewing the COPY ON_ERROR_TABLE patch and had a few implementation
questions that may be worth considering.

- The COPY multi-insert path currently depends on CopyMultiInsertBuffer
and table_multi_insert() batching behavior. Recovering from row-level
failures while buffers are partially populated may complicate buffer
consistency, trigger visibility, or index handling.
- Would it make sense to initially disable multi-insert batching when
ON_ERROR_TABLE is enabled (forcing CIM_SINGLE)? That seems like a simpler
starting point for correctness and recovery semantics.
- I was also curious about the intended transaction behavior for
rejected rows. Should rows written to the error table rollback together
with the surrounding COPY transaction if a later failure occurs?
- Another possible edge case is recursive failure handling if insertion
into the error table itself fails.

I have not yet reproduced a concrete failure case, so these are currently
review observations rather than confirmed issues.

Thanks for working on this feature.

Regards,
Vellaipandiyan

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonathan Gonzalez V. 2026-05-18 07:49:39 [oauth] Fix minimal typo in OAuth
Previous Message Ayush Tiwari 2026-05-18 06:26:06 Re: (SQL/PGQ) cache lookup failed for label