Re: Bug in copy - Mailing list pgsql-bugs

From Zhang Mingli
Subject Re: Bug in copy
Date
Msg-id fa5c934f-9b57-4900-ad15-bb9c6d9d414d@Spark
Whole thread Raw
Responses Re: Bug in copy
List pgsql-bugs
On Feb 8, 2025 at 13:28 +0800, me nefcanto <sn.1361@gmail.com>, wrote:
Hello
I run this command:
copy "Parts" ("Id","Title") from stdin with (format csv, delimiter ",", on_error ignore)
But I receive this error:
duplicate key value violates unique constraint "PartsUniqueLocaleTitle"
This means that the on_error setting is not working. When I try to insert a million records, this becomes extremely annoying and counterproductive.
When we specify that on_error should be ignored, any type of error including data type inconsistency, check constraint inconsistency, foreign key inconsistency, etc. should be ignored and Postgres should move to the next record and not fail the entire bulk operation.
RegardsSaeed Nemati

Hi,

As my understanding,  on_error is designed to handle errors during data type conversions in PostgreSQL, similar to what we do in Greenplum or Cloudberry. 
Since these rows are valid, on_error doesn’t raise any concerns.

--
Zhang Mingli
HashData

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Bug in copy
Next
From: me nefcanto
Date:
Subject: Re: Bug in copy