Обсуждение: COPY command and skipping errors

Поиск
Список
Период
Сортировка

COPY command and skipping errors

От
"Tomeh, Husam"
Дата:
 
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.
 
Thanks,


--
 Husam

 

---------------------------(end of broadcast)---------------------------

TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

**********************************************************************

This message contains confidential information intended only for the use of the addressee(s)

named above and may contain information that is legally privileged.  If you are not the

addressee, or the person responsible for delivering it to the addressee, you are hereby
notified that reading, disseminating, distributing or copying this message is strictly prohibited. 

If you have received this message by mistake, please immediately notify us by replying to the

message and delete the original message immediately thereafter.

 

Thank you.                                                                                                       FADLD Tag
**********************************************************************

Re: COPY command and skipping errors

От
Bruce Momjian
Дата:
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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: COPY command and skipping errors

От
Alvaro Herrera
Дата:
On Thu, Sep 22, 2005 at 04:41:57PM -0400, Bruce Momjian wrote:
> 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:

Also, I think PGLoader can do this.  It's on pgfoundry.org.

--
Alvaro Herrera                         Architect, http://www.EnterpriseDB.com
"Tiene valor aquel que admite que es un cobarde" (Fernandel)