Re: problem with copy command

From: George Moga <george(at)dsn(dot)ro>
To: Jaruwan Laongmal <jaruwan(at)gits(dot)net(dot)th>, pgsql-sql(at)postgresql(dot)org
Subject: Re: problem with copy command
Date: 2001-04-11 09:27:21
Message-ID: 3AD42379.3FD4F534@dsn.ro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tony Grant 2001-04-11 09:35:42 Re: JDBC and Perl compiling problems w/ postgresql-7.1rc4
Previous Message Marcin Wasilewski 2001-04-11 08:50:45 ORDER BY ????

Browse pgsql-sql by date

  From Date Subject
Next Message Hans-Jürgen Schönig 2001-04-11 10:09:36 Savepoints
Previous Message Cedar Cox 2001-04-11 08:56:30 Re: Foreign Key between different databases