Re: duplicate key value violates unique constraint "tableName_pk"

From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Saravanan Nagarajan <n(dot)saravanan86(at)gmail(dot)com>
Cc: Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: duplicate key value violates unique constraint "tableName_pk"
Date: 2012-11-07 17:21:03
Message-ID: CABOikdNZtJ2-fpUFe3saD3QonoLiiph2PS6QHDKB+1dnRxOGug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Nov 7, 2012 at 4:51 PM, Saravanan Nagarajan <n(dot)saravanan86(at)gmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2012-11-07 17:22:04 Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
Previous Message Denis Feklushkin 2012-11-07 17:04:05 Re: PQsendQueryParams() causes prepared statement error