Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 647812E31B6 for ; Fri, 14 Dec 2007 15:39:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 00817-04 for ; Fri, 14 Dec 2007 15:39:55 -0400 (AST) Received: from alexis.jtlnet.com (alexis.jtlnet.com [69.36.9.81]) by postgresql.org (Postfix) with ESMTP id 485A72E3162 for ; Fri, 14 Dec 2007 15:39:55 -0400 (AST) Received: from [192.168.10.103] (cpe-075-177-131-108.nc.res.rr.com [::ffff:75.177.131.108]) (AUTH: PLAIN andrew@dunslane.net, TLS: TLSv1/SSLv3, 256bits, AES256-SHA) by alexis.jtlnet.com with esmtp; Fri, 14 Dec 2007 14:40:49 -0500 id 0007FD48.4762DC42.00007CAB Message-ID: <4762DC05.1070003@dunslane.net> Date: Fri, 14 Dec 2007 14:39:49 -0500 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.12) Gecko/20071019 Fedora/1.0.9-3.fc6 pango-text SeaMonkey/1.0.9 MIME-Version: 1.0 To: Neil Conway CC: Hannu Krosing , Josh Berkus , pgsql-hackers@postgresql.org, Simon Riggs Subject: Re: VLDB Features 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> In-Reply-To: <1197660423.1536.8.camel@dell.linuxdev.us.dell.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/574 X-Sequence-Number: 111863 Neil Conway wrote: > On Fri, 2007-12-14 at 14:48 +0200, Hannu Krosing wrote: > >> How did you do it ? >> >> Did you enchance COPY command or was it something completely new ? >> > > 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. > > > Ideally I think you would put the failing input line in another table, or maybe another file. If a table, it would probably have to be as bytea. cheers andrew