Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B7A04635143 for ; Wed, 26 Aug 2009 19:26:15 -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 24028-01-2 for ; Wed, 26 Aug 2009 22:26:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out.mail.amis.hr (out.mail.amis.hr [194.146.109.163]) by mail.postgresql.org (Postfix) with ESMTP id 92C5763455A for ; Wed, 26 Aug 2009 19:26:07 -0300 (ADT) Received: from in.mail.amis.hr (in.mail.amis.hr [194.146.109.162]) by out.mail.amis.hr (Postfix) with ESMTP id 7437566854B; Thu, 27 Aug 2009 00:25:25 +0200 (CEST) Received: from localhost (unknown [194.146.109.168]) by in.mail.amis.hr (Postfix) with ESMTP id B4A4C181484; Thu, 27 Aug 2009 00:26:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at amis.hr Received: from in.mail.amis.hr ([194.146.109.162]) by localhost (scan.amis.hr [194.146.109.168]) (amavisd-new, port 10024) with ESMTP id LsJiTcRkQhcV; Thu, 27 Aug 2009 00:26:03 +0200 (CEST) Received: from imap.amis.hr (imap.amis.hr [194.146.109.164]) by in.mail.amis.hr (Postfix) with ESMTP id 2CF1C18147F; Thu, 27 Aug 2009 00:26:03 +0200 (CEST) Received: from [192.168.10.1] (cpe-188-129-72-47.dynamic.amis.hr [188.129.72.47]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by imap.amis.hr (Postfix) with ESMTP id C79BE573751; Thu, 27 Aug 2009 00:26:02 +0200 (CEST) Message-ID: <4A95B674.2020103@megafon.hr> Date: Thu, 27 Aug 2009 00:25:56 +0200 From: Mario Splivalo User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: John R Pierce CC: pgsql-jdbc@postgresql.org Subject: Re: Inserting 'large' amounts of data References: <4A9562BC.8030804@megafon.hr> <4A956E17.9020607@hogranch.com> In-Reply-To: <4A956E17.9020607@hogranch.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.11 tagged_above=-10 required=5 tests=BAYES_05=-1.11, RCVD_IN_DNSWL_LOW=-1 X-Spam-Level: X-Archive-Number: 200908/66 X-Sequence-Number: 19915 John R Pierce wrote: > 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 ... Yes, I gues this is the way to go. I'll have to upgrade to 8.4, but somehow I'd like to wait for a month or so before making the switch. Thank you all. Mike