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

Re: COPY command and skipping errors

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Tomeh, Husam" <htomeh(at)firstam(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: COPY command and skipping errors
Date: 2005-09-22 20:41:57
Message-ID: 200509222041.j8MKfvj03938@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-admin
Tomeh, Husam wrote:
>  
> Is there a way to skip errors during the run of the COPY command
> (loading data from a file to a table) like what Oracle SQL*Loader has?
> The reason I'm asking is that if the extract file from the mainframe has
> an invalid character, the COPY terminates and doesn't continue loading
> the rest of records.

No, but it is on the TODO list:

        o Allow COPY to report error lines and continue

          This requires the use of a savepoint before each COPY line is
          processed, with ROLLBACK on COPY failure.


-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-admin by date

Next:From: Hannes DorbathDate: 2005-09-22 21:07:22
Subject: Re: Backing up several tables using pg_dump -t
Previous:From: Rajesh Kumar MallahDate: 2005-09-22 20:15:58
Subject: Re: Backing up several tables using pg_dump -t

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