X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0CBBFD91E3 for ; Thu, 22 Sep 2005 17:42:01 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09148-01 for ; Thu, 22 Sep 2005 20:41:55 +0000 (GMT) Received: from candle.pha.pa.us (candle.pha.pa.us [64.139.89.126]) by svr1.postgresql.org (Postfix) with ESMTP id 2D6FFD957B for ; Thu, 22 Sep 2005 17:41:55 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id j8MKfvj03938; Thu, 22 Sep 2005 16:41:57 -0400 (EDT) From: Bruce Momjian Message-Id: <200509222041.j8MKfvj03938@candle.pha.pa.us> Subject: Re: COPY command and skipping errors In-Reply-To: To: "Tomeh, Husam" Date: Thu, 22 Sep 2005 16:41:57 -0400 (EDT) Cc: pgsql-admin@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.01 required=5 tests=[AWL=0.010] X-Spam-Level: X-Archive-Number: 200509/240 X-Sequence-Number: 18977 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