pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
COPY command and skipping errors
3+ messages / 3 participants
[nested] [flat]

* COPY command and skipping errors
@ 2005-09-22 19:32  Tomeh, Husam <htomeh@firstam.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tomeh, Husam @ 2005-09-22 19:32 UTC (permalink / raw)
  To: pgsql-admin

 
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 <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
**********************************************************************

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re:  COPY command and skipping errors
@ 2005-09-22 20:41  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Tomeh, Husam <htomeh@firstam.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Bruce Momjian @ 2005-09-22 20:41 UTC (permalink / raw)
  To: Tomeh, Husam <htomeh@firstam.com>; +Cc: 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@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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re:  COPY command and skipping errors
@ 2005-09-22 21:14  Alvaro Herrera <alvherre@alvh.no-ip.org>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Alvaro Herrera @ 2005-09-22 21:14 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: Tomeh, Husam <htomeh@firstam.com>; pgsql-admin

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)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-09-22 21:14 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-09-22 19:32 COPY command and skipping errors Tomeh, Husam <htomeh@firstam.com>
2005-09-22 20:41 ` Bruce Momjian <pgman@candle.pha.pa.us>
2005-09-22 21:14   ` Alvaro Herrera <alvherre@alvh.no-ip.org>

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