Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id EF6432E016A for ; Fri, 14 Dec 2007 19:22:54 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 52405-05 for ; Fri, 14 Dec 2007 19:22:44 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id DC7C02E017C for ; Fri, 14 Dec 2007 19:22:47 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lBENMfm8015008; Fri, 14 Dec 2007 18:22:41 -0500 (EST) To: Neil Conway cc: Hannu Krosing , Josh Berkus , pgsql-hackers@postgresql.org, Simon Riggs Subject: Re: VLDB Features In-reply-to: <1197660423.1536.8.camel@dell.linuxdev.us.dell.com> References: <1197371508.4255.1327.camel@ebony.site> <200712111053.11178.josh@agliodbs.com> <1197416461.29432.10.camel@dell.linuxdev.us.dell.com> <1197636530.7974.16.camel@hannu-laptop> <1197660423.1536.8.camel@dell.linuxdev.us.dell.com> Comments: In-reply-to Neil Conway message dated "Fri, 14 Dec 2007 11:27:03 -0800" Date: Fri, 14 Dec 2007 18:22:41 -0500 Message-ID: <15007.1197674561@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/575 X-Sequence-Number: 111864 Neil Conway writes: > By modifying COPY: COPY IGNORE ERRORS or some such would instruct COPY > to drop (and log) rows that contain malformed data. That is, rows with > too many or too few columns, rows that result in constraint violations, > and rows containing columns where the data type's input function raises > an error. The last case is the only thing that would be a bit tricky to > implement, I think: you could use PG_TRY() around the InputFunctionCall, > but I guess you'd need a subtransaction to ensure that you reset your > state correctly after catching an error. Yeah. It's the subtransaction per row that's daunting --- not only the cycles spent for that, but the ensuing limitation to 4G rows imported per COPY. If we could somehow only do a subtransaction per failure, things would be much better, but I don't see how. regards, tom lane