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

From David G. Johnston
Subject Re: Please implement a catch-all error handler per row, for COPY
Date
Msg-id CAKFQuwbRCWP2DMHyW1LABuWAjDFVGE4mPJNfXOeTqzMpeBQ_Hw@mail.gmail.com
Whole thread Raw
In response to Re: Please implement a catch-all error handler per row, for COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Please implement a catch-all error handler per row, for COPY
List pgsql-general
On Sat, Mar 1, 2025 at 9:20 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
me nefcanto <sn.1361@gmail.com> 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 would.

Maybe it isn't a general purpose ETL tool but there is no reasonable way to do some things unless COPY can be put into a mode that doesn't have the same performance requirements it needs to serve as our dump/restore tool of choice.

I have to imagine such a mode, if not enabled, would have little to no impact on how COPY behaves compared to today.  It's kinda like VACUUM FULL existing doesn't impact how VACUUM behaves.  Seems more desirable than inventing a whole new SQL Command to do this and copy-paste all of the COPY code since it does mostly the same thing.

In short, it's probably worth giving it a try if someone wants to.  Rejecting it without seeing the proposal seems premature.

Now, it's probably challenging enough that if the person requesting the feature isn't driving its development the odds of it getting worked on is fairly low.

David J.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Please implement a catch-all error handler per row, for COPY
Next
From: Adrian Klaver
Date:
Subject: Re: create_immv issue on aws Ubuntu even after create extention