Re: ignore duplicate key while using COPY? - Mailing list pgsql-general

From Yan Chunlu
Subject Re: ignore duplicate key while using COPY?
Date
Msg-id CAOA66tFe3T=8nYtMZRAaysADqGxs_pJRqFZitVP+YsnVsbYCSQ@mail.gmail.com
Whole thread Raw
In response to Re: ignore duplicate key while using COPY?  (Adrian Klaver <adrian.klaver@gmail.com>)
List pgsql-general
thanks a lot!

On Mon, Dec 19, 2011 at 10:19 PM, Adrian Klaver <adrian.klaver@gmail.com> wrote:
On Sunday, December 18, 2011 10:54:21 pm Yan Chunlu wrote:
> I am using COPY public.table_name FROM STDIN  to import data.  it is
> very efficient, but if there's any duplicate key exists, the whole
> procedure has been stopped.  is there anyway to around this?
>
> why does not postgresql just give a warning and continue the copy?

Take a look at pgloader:
http://pgfoundry.org/projects/pgloader/

--
Adrian Klaver
adrian.klaver@gmail.com

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Escaping input from COPY
Next
From: Dinesh Kumara
Date:
Subject: Cursor loop - stop current iteration and continue with next iteration