Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 72A189FA2CA for ; Mon, 11 Dec 2006 13:01:27 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 96557-03 for ; Mon, 11 Dec 2006 13:01:21 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.178]) by postgresql.org (Postfix) with ESMTP id 2E0949F9FE1 for ; Mon, 11 Dec 2006 13:01:22 -0400 (AST) Received: by py-out-1112.google.com with SMTP id a73so434906pye for ; Mon, 11 Dec 2006 09:01:21 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=t89zpfueTsX6f6Ib8JlQ89jgXcJ2KdqR6Mmydud2Emrtl8kcRomkOxVzL7ZAOhyy5c4z1nAva9MoL5Y4vjzgMbk9kXYWdZDOAKcLOKvb1lppebA8M/nahKzESX1OBQa2IndPnmEU4Uaxz7VzJSMqicq3Qk8SpGNQ5kUXyBUo+ok= Received: by 10.35.40.10 with SMTP id s10mr12892439pyj.1165856468287; Mon, 11 Dec 2006 09:01:08 -0800 (PST) Received: by 10.35.80.10 with HTTP; Mon, 11 Dec 2006 09:01:08 -0800 (PST) Message-ID: Date: Mon, 11 Dec 2006 22:31:08 +0530 From: "Rajesh Kumar Mallah" To: "Jens Schipkowski" Subject: Re: really quick multiple inserts can use COPY? Cc: pgsql-performance@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/244 X-Sequence-Number: 22300 > So, my questions: > Is it possible to use COPY FROM STDIN with JDBC? Should be. Its at least possible using DBI and DBD::Pg (perl) my $copy_sth = $dbh -> prepare( "COPY general.datamining_mailing_lists (query_id,email_key) FROM STDIN;") ; $copy_sth -> execute(); while (my ($email_key ) = $fetch_sth -> fetchrow_array ()) { $dbh -> func("$query_id\t$email_key\n", 'putline'); } $fetch_sth -> finish(); $dbh -> func("\\.\n", 'putline'); $dbh -> func('endcopy'); $copy_sth->finish(); Some JDBC expert would tell better how its done with JDBC. > Will it bring performance improvement compared to SELECT UNION solution? COPY is quite faast. Regds mallah. > > many thanks in advance, > Jens Schipkowski > > -- > ** > APUS Software GmbH > > ---------------------------(end of broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >