On 11/07/2012 07:21 PM, Saravanan Nagarajan 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.
Typically you COPY into a temporary or UNLOGGED table, then merge the
data into the target table using appropriate `UPDATE ... FROM ... WHERE`
and `INSERT ... SELECT ... WHERE` statements.

--
Craig Ringer


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to