Re: Conflict handling for COPY FROM

From: Surafel Temesgen <surafel3000(at)gmail(dot)com>
To: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
Cc: asaba(dot)takanori(at)fujitsu(dot)com, Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Anthony Nowocien <anowocien(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Conflict handling for COPY FROM
Date: 2020-02-17 08:07:48
Message-ID: CALAY4q9GtfScUoafzin8zFQ-UjXB65hByFy1jsS=VNbX9dvuXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 17, 2020 at 10:00 AM Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp> wrote:

> >> test=# copy t1 from '/tmp/a' with (error_limit 1);
> >> ERROR: duplicate key value violates unique constraint "t1_pkey"
> >> DETAIL: Key (i)=(2) already exists.
> >> CONTEXT: COPY t1, line 2: "2 2"
> >>
> >> So if the number of errors raised exceeds error_limit, no constaraint
> >> violating rows (in this case i=1, j=1) are returned.
> >>
> >
> > error_limit is specified to dictate the number of error allowed in copy
> > operation
> > to precede. If it exceed the number the operation is stopped. there may
> > be more conflict afterward and returning limited number of conflicting
> rows
> > have no much use
>
> Still I see your explanation differs from what the document patch says.
>
> + Currently, only unique or exclusion constraint violation
> + and rows formatting errors are ignored. Malformed
> + rows will rise warnings, while constraint violating rows
> + will be returned back to the caller.
>
> I am afraid once this patch is part of next version of PostgreSQL, we
> get many complains/inqueires from users. What about changing like this:
>
> Currently, only unique or exclusion constraint violation and
> rows formatting errors are ignored. Malformed rows will rise
> warnings, while constraint violating rows will be returned back
> to the caller unless any error is raised; i.e. if any error is
> raised due to error_limit exceeds, no rows will be returned back
> to the caller.
>

Its better so amended .

regards
Surafel

Attachment Content-Type Size
conflict-handling-q-from-v14.patch text/x-patch 16.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2020-02-17 08:13:47 Re: table partitioning and access privileges
Previous Message Fujii Masao 2020-02-17 07:59:46 Re: table partitioning and access privileges