Skip site navigation (1) Skip section navigation (2)

Re: Copy cmd error

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: qinghuamail-postgresqlfans(at)yahoo(dot)com
Cc: postgresql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Copy cmd error
Date: 2007-08-27 21:40:25
Message-ID: dcc563d10708271440r469fee38h6aacf1d48ce93f51@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
On 8/27/07, qinghuamail-postgresqlfans(at)yahoo(dot)com
<qinghuamail-postgresqlfans(at)yahoo(dot)com> wrote:
> hi,all
>
> I use COPY cmd to import large data to database,but I have a question,
>
> when occured the first error, It always stopped, I need it to be
> continue,and reject the error rows to a file, how to do this?

There are two common ways to do this.

First, import to a temp table then fix up the data there until an
"insert into real_table select * from temp_table" type statement to
import the data.

The second is to swrite some kind of app in bash, perl, php, awd, sed,
C or whatever language you like to put the data into a format that the
database won't choke on.

In response to

  • Copy cmd error at 2007-08-27 08:18:35 from qinghuamail-postgresqlfans

pgsql-admin by date

Next:From: Robert TreatDate: 2007-08-27 21:42:57
Subject: how is pitr replay interruption time determined?
Previous:From: Neil Peter BraggioDate: 2007-08-27 21:28:29
Subject: Re: Problems connecting to postgres using JDBC Driver.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group