Conflict handling for COPY FROM - Mailing list pgsql-hackers

From Surafel Temesgen
Subject Conflict handling for COPY FROM
Date
Msg-id CALAY4q8PcAcTUVgjvKkNxenoAcydiwUuYhwNwad4kcZQ9Ewdbw@mail.gmail.com
Whole thread Raw
Responses Re: Conflict handling for COPY FROM
Re: Conflict handling for COPY FROM
List pgsql-hackers

Hellow hackers,

A few commitfest ago there was same effort to add errors handling to COPY FROM[1] and i see there that we already have infrastructure for supporting handling of unique violation or exclusion constraint violation error and I think it is independently useful too. Attached is a patch to do that.

In order to prevent extreme condition the patch also add a new GUC variable called copy_max_error_limit that control the amount of error to swallow before start to error and new failed record file options for copy to write a failed record so the user can examine it.

With the new option COPY FROM can be specified like:

COPY table_name [ ( column_name [, ...] ) ]

FROM { 'filename' | PROGRAM 'command' | STDIN }[ON CONFLICT IGNORE failed_record_filename] [ [ WITH ] ( option [, ...] ) ]

[1].https://www.postgresql.org/message-id/flat/7179F2FD-49CE-4093-AE14-1B26C5DFB0DA@gmail.com

Comment?

Regards

Surafel

Attachment

pgsql-hackers by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: Stored procedures and out parameters
Next
From: Kohei KaiGai
Date:
Subject: Re: [report] memory leaks in COPY FROM on partitioned table