X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1C1AAD1D14B for ; Sat, 21 Feb 2004 16:03:51 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 69718-09 for ; Sat, 21 Feb 2004 12:03:49 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 180C9D1B860 for ; Sat, 21 Feb 2004 12:03:49 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i1LG3jUa011943; Sat, 21 Feb 2004 11:03:45 -0500 (EST) To: "Michael L. Hostbaek" Cc: pgsql-sql@postgresql.org Subject: Re: postgresql multiple insert slow In-reply-to: <20040219163238.GD10913@mich2.itxmarket.com> References: <20040219163238.GD10913@mich2.itxmarket.com> Comments: In-reply-to "Michael L. Hostbaek" message dated "Thu, 19 Feb 2004 17:32:38 +0100" Date: Sat, 21 Feb 2004 11:03:45 -0500 Message-ID: <11942.1077379425@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/329 X-Sequence-Number: 17019 "Michael L. Hostbaek" writes: > I runs fine - and I get no errors - but it takes almost 25 minutes to > complete.. I tried running the script while just grabbing the rows from > the oracle database and writing to a text file - and then it only takes > a couple of minutes .. So it must be the INSERT command that chokes - is > there a better way to do it ? You probably want to add BEGIN/COMMIT operations around the loop. See the documentation's tips on bulk data loading: http://www.postgresql.org/docs/7.4/static/populate.html regards, tom lane