expand on_error ignore error handling scope

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: expand on_error ignore error handling scope
Date: 2025-04-30 00:00:00
Message-ID: CACJufxHCwG=Z1L94mi7SrXpBsv3iGUk1S7JQP1WKvy3cxb=vMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hi.

Currently, (on_error ignore) only handles data type incompatibility errors.
However, we can extend its functionality to also handle errors caused by extra
data (additional columns) or missing data (fewer columns), I think.

on_error is only applicable to non-binary formats.
In non-binary formats (such as text and CSV), COPY FROM cut income source row by
row by newline. This means that row boundaries are clearly defined. If a
line's contents cannot be successfully converted to the table's columns, an
error is raised.

Based on this, I think it's doable to let on_error ignore handling missing and
extra data errors.
Hope I didn't miss anything.

previously feature request discussion: [1]
[1]: https://postgr.es/m/CAEHBEOCqqkSitU5gx%3D8aHD3ZeLtRy-1eC%3DXs%3DxB-thFNR9JpYA%40mail.gmail.com

what do you think?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-04-30 00:08:51 Re: Sequence Access Methods, round two
Previous Message Peter Geoghegan 2025-04-29 22:51:38 Re: Adding skip scan (including MDAM style range skip scan) to nbtree