Re: problem with copy command - Mailing list pgsql-sql

From George Moga
Subject Re: problem with copy command
Date
Msg-id 3AD42379.3FD4F534@dsn.ro
Whole thread Raw
In response to problem with copy command  ("Jaruwan Laongmal" <jaruwan@gits.net.th>)
Responses Re: problem with copy command
List pgsql-sql
Jaruwan Laongmal wrote:

> dear all,
> I currently using postgresql v7.0.3
> when i import text file to table with command "copy tablename from
> '/tmp/a.txt';
> and it shows
> "copy: line 20, Cannot insert a duplicate key into unique index testpri_pk"
> ,then it exits with doing nothing.
>
> I want to ignore this errors and continue copy the next record. How to do
> that?
> if I don't filter in '/tmp/a.txt' before using copy command.
>
> Thank you so much for your help in advance .
> Regards
> Jaruwan

Try to delete the unique index testpri_pk ... but if you want to create the
unique index again you must delete (or modify) you'r not_unique rows.


George Moga,   Data Systems Srl   Slobozia, ROMANIA




pgsql-sql by date:

Previous
From: Cedar Cox
Date:
Subject: Re: Foreign Key between different databases
Next
From: Amanda Riera
Date:
Subject: Concatenate fields