Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id E1AB32E01BE for ; Fri, 14 Dec 2007 20:18:21 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 51965-08 for ; Fri, 14 Dec 2007 20:18:10 -0400 (AST) Received: from mailbox.samurai.com (mailbox.samurai.com [205.207.28.82]) by postgresql.org (Postfix) with ESMTP id 3322A2E0033 for ; Fri, 14 Dec 2007 20:18:17 -0400 (AST) Received: from localhost (mailbox.samurai.com [205.207.28.82]) by mailbox.samurai.com (Postfix) with ESMTP id 48C7B61D4C; Fri, 14 Dec 2007 19:18:16 -0500 (EST) X-Virus-Scanned: by amavisd-new at mailbox.samurai.com Received: from mailbox.samurai.com ([205.207.28.82]) by localhost (mailbox.samurai.com [205.207.28.82]) (amavisd-new, port 10024) with LMTP id p1M5KqiKWy8B; Fri, 14 Dec 2007 19:18:14 -0500 (EST) Received: from [10.10.30.141] (204.11.227.33.static.etheric.net [204.11.227.33]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailbox.samurai.com (Postfix) with ESMTP id 998B061D3D; Fri, 14 Dec 2007 19:18:13 -0500 (EST) Subject: Re: VLDB Features From: Neil Conway To: Tom Lane Cc: Hannu Krosing , Josh Berkus , pgsql-hackers@postgresql.org, Simon Riggs In-Reply-To: <15007.1197674561@sss.pgh.pa.us> 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> <15007.1197674561@sss.pgh.pa.us> Content-Type: text/plain Date: Fri, 14 Dec 2007 16:18:50 -0800 Message-Id: <1197677930.1536.18.camel@dell.linuxdev.us.dell.com> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/578 X-Sequence-Number: 111867 On Fri, 2007-12-14 at 18:22 -0500, Tom Lane wrote: > If we could somehow only do a subtransaction per failure, things would > be much better, but I don't see how. One approach would be to essentially implement the pg_bulkloader approach inside the backend. That is, begin by doing a subtransaction for every k rows (with k = 1000, say). If you get any errors, then either repeat the process with k/2 until you locate the individual row(s) causing the trouble, or perhaps just immediately switch to k = 1. Fairly ugly though, and would be quite slow for data sets with a high proportion of erroneous data. Another approach would be to distinguish between errors that require a subtransaction to recover to a consistent state, and less serious errors that don't have this requirement (e.g. invalid input to a data type input function). If all the errors that we want to tolerate during a bulk load fall into the latter category, we can do without subtransactions. -Neil