From: | torikoshia <torikoshia(at)oss(dot)nttdata(dot)com> |
---|---|
To: | jian he <jian(dot)universality(at)gmail(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: expand on_error ignore error handling scope |
Date: | 2025-06-05 02:15:40 |
Message-ID: | 62cb7a5864a00e12bac0c055cdb0d7d7@oss.nttdata.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2025-04-30 09:00, jian he wrote:
> 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?
I've heard similar feedback from users who were surprised that setting
on_error = ignore didn't suppress errors due to column count mismatches.
Supporting this case as well might make the feature more intuitive and
helpful for users.
That said, there might be cases where users actually want column count
mismatches to result in an error, even when on_error is set to ignore.
So perhaps it could be worth considering -- just as an idea -- whether
we should allow more fine-grained control over which kinds of errors to
ignore, e.g., adding a new option to what type of errors are ignored.
--
Regards,
--
Atsushi Torikoshi
Seconded from NTT DATA GROUP CORPORATION to SRA OSS K.K.
From | Date | Subject | |
---|---|---|---|
Next Message | Hayato Kuroda (Fujitsu) | 2025-06-05 03:00:26 | RE: Missing program_XXX calling in pgbench tests |
Previous Message | Zhijie Hou (Fujitsu) | 2025-06-05 02:08:51 | RE: Conflict detection for update_deleted in logical replication |