From: Zhang Mingli <zmlpostgres@gmail.com>
To: pgsql-bugs@lists.postgresql.org, me nefcanto <sn.1361@gmail.com>
Subject: Re: Bug in copy
Date: Sat, 8 Feb 2025 13:52:14 +0800
Message-ID: <fa5c934f-9b57-4900-ad15-bb9c6d9d414d@Spark> (raw)
In-Reply-To: <CAEHBEOBCweDWGNHDaUk4=10HG0QXXJJAGXbEnFLMB30M+Qw+dg@mail.gmail.com>
References: <CAEHBEOBCweDWGNHDaUk4=10HG0QXXJJAGXbEnFLMB30M+Qw+dg@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: zmlpostgres@gmail.com, sn.1361@gmail.com
Subject: Re: Bug in copy
In-Reply-To: <fa5c934f-9b57-4900-ad15-bb9c6d9d414d@Spark>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox