From: Scott Marlowe <scott.marlowe@gmail.com>
To: qinghuamail-postgresqlfans@yahoo.com
Cc: postgresql-admin <pgsql-admin@postgresql.org>
Subject: Re: Copy cmd error
Date: Mon, 27 Aug 2007 16:40:25 -0500
Message-ID: <dcc563d10708271440r469fee38h6aacf1d48ce93f51@mail.gmail.com> (raw)
In-Reply-To: <972942.48089.qm@web58108.mail.re3.yahoo.com>
References: <972942.48089.qm@web58108.mail.re3.yahoo.com>
On 8/27/07, qinghuamail-postgresqlfans@yahoo.com
<qinghuamail-postgresqlfans@yahoo.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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: scott.marlowe@gmail.com, qinghuamail-postgresqlfans@yahoo.com
Subject: Re: Copy cmd error
In-Reply-To: <dcc563d10708271440r469fee38h6aacf1d48ce93f51@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox