From: Pavan Deolasee <pavan.deolasee@gmail.com>
To: Saravanan Nagarajan <n.saravanan86@gmail.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: duplicate key value violates unique constraint "tableName_pk"
Date: Wed, 7 Nov 2012 22:51:03 +0530
Message-ID: <CABOikdNZtJ2-fpUFe3saD3QonoLiiph2PS6QHDKB+1dnRxOGug@mail.gmail.com> (raw)
In-Reply-To: <CANYLzthssbdi4LSYmL9NJ6XsHJcm=Ni8qBMEJtzuij4jCO7Gtw@mail.gmail.com>
References: <CANYLzthssbdi4LSYmL9NJ6XsHJcm=Ni8qBMEJtzuij4jCO7Gtw@mail.gmail.com>
On Wed, Nov 7, 2012 at 4:51 PM, Saravanan Nagarajan <n.saravanan86@gmail.com
> wrote:
> Hi ,
>
> I am using "Copy From" while dumping bulk data into PGSQL DB from file.
> While I am trying to insert the rows, if the primary key already exists,
> the complete transaction terminated.
>
> Postgres cannot handle the constraint violations , i found it into
> http://wiki.postgresql.org/wiki/COPY#Caveats_with_implementation .
>
> Is there any possible way to insert bulk data using "Copy From" with
> REPLACE/IGNORE duplicates.
>
>
Did you look at http://pgbulkload.projects.pgfoundry.org/pg_bulkload.html ?
That advertises to have the features that you are looking for. I would
expect pg_bulkload to also perform equal if not better than COPY command.
Thanks,
Pavan
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: pavan.deolasee@gmail.com, n.saravanan86@gmail.com
Subject: Re: duplicate key value violates unique constraint "tableName_pk"
In-Reply-To: <CABOikdNZtJ2-fpUFe3saD3QonoLiiph2PS6QHDKB+1dnRxOGug@mail.gmail.com>
References: <CANYLzthssbdi4LSYmL9NJ6XsHJcm=Ni8qBMEJtzuij4jCO7Gtw@mail.gmail.com> <CABOikdNZtJ2-fpUFe3saD3QonoLiiph2PS6QHDKB+1dnRxOGug@mail.gmail.com>
* 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