pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Sandeep Khandelwal <sandeep_khandelwal27@yahoo.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: COPY command with bad input
Date: Thu, 17 May 2007 06:10:42 -0600
Message-ID: <20070517121042.GA26576@winnie.fuhr.org> (raw)
In-Reply-To: <126544.67764.qm@web33313.mail.mud.yahoo.com>
References: <126544.67764.qm@web33313.mail.mud.yahoo.com>

On Tue, May 15, 2007 at 02:11:00AM -0700, Sandeep Khandelwal wrote:
> I am trying to load data from a text file to Postgres table using
> COPY command. If text file has some invalid rows then COPY command
> stops at the first error.
> 
> As you can see, MySQL “load data infile” has IGNORE option.  If you
> specify IGNORE, input rows that duplicate an existing row on a
> unique key value are skipped. Do we have similar option for Postgres
> COPY command ?

Not yet; it's on the developers' TODO list:

http://www.postgresql.org/docs/faqs.TODO.html

  * Allow COPY to report error lines and continue

In the meantime you could check out pgloader:

http://pgfoundry.org/projects/pgloader/

-- 
Michael Fuhr



view thread (3+ messages)

Message-ID: <20070517121042.GA26576@winnie.fuhr.org>
Permalink:  ../20070517121042.GA26576@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20070517121042.GA26576@winnie.fuhr.org

 · 

reply

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-interfaces@postgresql.org
  Cc: mike@fuhr.org, sandeep_khandelwal27@yahoo.com
  Subject: Re: COPY command with bad input
  In-Reply-To: <20070517121042.GA26576@winnie.fuhr.org>

* 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