Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B806063455A for ; Wed, 26 Aug 2009 14:18:18 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 99724-07 for ; Wed, 26 Aug 2009 17:18:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hogranch.com (hogranch.com [75.101.82.47]) by mail.postgresql.org (Postfix) with ESMTP id B3B5A633B75 for ; Wed, 26 Aug 2009 14:18:10 -0300 (ADT) Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id n7QHHBj15907; Wed, 26 Aug 2009 10:17:11 -0700 Message-ID: <4A956E17.9020607@hogranch.com> Date: Wed, 26 Aug 2009 10:17:11 -0700 From: John R Pierce User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Mario Splivalo CC: pgsql-jdbc@postgresql.org Subject: Re: Inserting 'large' amounts of data References: <4A9562BC.8030804@megafon.hr> In-Reply-To: <4A9562BC.8030804@megafon.hr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.74 tagged_above=-10 required=5 tests=BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 200908/63 X-Sequence-Number: 19912 Mario Splivalo wrote: > I have a web application which allows users to upload a lot of phone > numbers. I need to store those numbers to a database. Usualy, one would > upload around 70k-100k of records, totaling around 2 MB in size. > > ... > t would one recommend as the best way to insert those data? > I believe you can use org.postgresql.copy.CopyIn() ... there are variants that use a writeToCopy() call to send the data, or a java.io.InputStream, or a java.io.Reader ...