Re: when COPY violates Primary Keys

From: Chris <dmagick(at)gmail(dot)com>
To: Joao Ferreira gmail <joao(dot)miguel(dot)c(dot)ferreira(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: when COPY violates Primary Keys
Date: 2008-10-09 23:43:45
Message-ID: 48EE9731.2090702@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joao Ferreira gmail wrote:
> Hello all,
>
> I have a ascii dump file based on the COPY operation.
>
> lets say I restore this dump into a live database with applications
> doing INSERTs and UPDATEs onto it.
>
> in case the COPY of a register causes a primary key (or UNIQUE, or FK)
> violation does the psql restore command try to continue the operation
> until it has parsed the whole dump, or does it abort on the first
> violation ?

Copy is all or nothing. It'll abort as soon as a violation happens.

the bulkloader on pgfoundry (http://pgfoundry.org/projects/pgbulkload/)
can apparently handle this for you...

--
Postgresql & php tutorials
http://www.designmagick.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message ITAGAKI Takahiro 2008-10-10 00:04:04 Re: when COPY violates Primary Keys
Previous Message Bart Grantham 2008-10-09 21:34:22 Opteron vs. Xeon performance differences