Re: Please implement a catch-all error handler per row, for COPY

2025-03-03 Thread Laurenz Albe
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? Im

Re: Please implement a catch-all error handler per row, for COPY

2025-03-02 Thread Adrian Klaver
On 3/2/25 19:44, me nefcanto wrote: Thank you all for responding. With respect, I don't understand why COPY gets related to ETL. All of the requirements I mentioned above have nothing to do with ETL. We have a table of categories. A hierarchical table. This is a multitenant app. Hundreds of tho

Re: Please implement a catch-all error handler per row, for COPY

2025-03-02 Thread Tom Lane
me nefcanto writes: > 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. You are wrong. See https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=d9f7f5d32 https://git

Re: Please implement a catch-all error handler per row, for COPY

2025-03-02 Thread Christophe Pettus
> On Mar 2, 2025, at 19:44, me nefcanto wrote: > > As I have specified in the bug thread, from 11 RDBMSs, 7 support this. Thus > it's not an uncommon weird request. If your organization is interested in producing a design and a patch, or paying a developer or organization to do so, that wou

Re: Please implement a catch-all error handler per row, for COPY

2025-03-02 Thread me nefcanto
Thank you all for responding. With respect, I don't understand why COPY gets related to ETL. All of the requirements I mentioned above have nothing to do with ETL. We have a table of categories. A hierarchical table. This is a multitenant app. Hundreds of thousands of records are in it. We want to

Re: Please implement a catch-all error handler per row, for COPY

2025-03-01 Thread Greg Sabino Mullane
FYI the -bugs thread in question: https://www.postgresql.org/message-id/flat/CAEHBEOBCweDWGNHDaUk4%3D10HG0QXXJJAGXbEnFLMB30M%2BQw%2Bdg%40mail.gmail.com seems to imply the primary blocker was a unique constraint. Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Soft

Re: Please implement a catch-all error handler per row, for COPY

2025-03-01 Thread Adrian Klaver
On 3/1/25 07:18, me nefcanto wrote: Hello All of these scenarios are such that data sanitation is difficult if not possible before doing the bulk operation (copy). I realized that when we specify `on_error ignore` it just handles a handful of errors. I thought this was a bug and sent an ema

Re: Please implement a catch-all error handler per row, for COPY

2025-03-01 Thread David G. Johnston
On Sat, Mar 1, 2025 at 9:20 AM Tom Lane wrote: > me nefcanto writes: > > Can you please provide a row-level catch-all handler for the copy > command? > > Very unlikely to happen. COPY is not intended as a general purpose > ETL mechanism, and we don't want to load it down with features that > wo

Re: Please implement a catch-all error handler per row, for COPY

2025-03-01 Thread Tom Lane
me nefcanto writes: > Can you please provide a row-level catch-all handler for the copy command? Very unlikely to happen. COPY is not intended as a general purpose ETL mechanism, and we don't want to load it down with features that would create substantial performance penalties. Which that woul

Please implement a catch-all error handler per row, for COPY

2025-03-01 Thread me nefcanto
Hello Please consider these scenarios: - I want to create a million fake products, sometimes even 100 million (we're on MariaDB now and we plan to migrate to Postgres). My team uses fake data for performance tests and other use cases. - Another scenario is translations. Even in production, we hav