Re: Please implement a catch-all error handler per row, for COPY - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Please implement a catch-all error handler per row, for COPY
Date
Msg-id b67f0fc8f3eb3b798b9c7145b20a0033af2da47e.camel@cybertec.at
Whole thread Raw
In response to Re: Please implement a catch-all error handler per row, for COPY  (me nefcanto <sn.1361@gmail.com>)
List pgsql-general
On Mon, 2025-03-03 at 07:14 +0330, me nefcanto wrote:
> The point is, that there is already an `on_error ignore` clause there. This means that
> somewhere there is a try/catch per row. If I'm wrong, please let me know.

The crucial point that Tom referred to is the "per row".  What is a row?

Imagine you have a COPY FROM statement for a table with three columns,
and the data look like this:

1,Smith,John
2,Lewis,Jerry
Lee
3,Prince
4,Albe,Laurenz

We may be able to guess what is meant, but how shall the machine know
where the line boundaries are, which data to ignore and which to process?

Currently, that is no problem, because errors are only identified
after the data have been successfully parsed.

Yours,
Laurenz Albe



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Please implement a catch-all error handler per row, for COPY
Next
From: Jakob Teuber
Date:
Subject: Infinite loop for generate_series with timestamp arguments