X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 902DF9FA434 for ; Wed, 19 Jul 2006 04:38:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 82983-03 for ; Wed, 19 Jul 2006 04:38:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mx00.ext.bfk.de (mx00.ext.bfk.de [217.29.46.125]) by postgresql.org (Postfix) with ESMTP id B4E1A9FA430 for ; Wed, 19 Jul 2006 04:38:13 -0300 (ADT) Received: from fweimer by bfk.de with local id 1G36dH-0006D5-08; Wed, 19 Jul 2006 09:38:11 +0200 To: Cc: Subject: Re: Performance penalty for remote access of postgresql (8.1.3)? any experiance? References: <003501c6ab05$a4978f20$74304c93@eddy> From: Florian Weimer Date: Wed, 19 Jul 2006 09:38:10 +0200 In-Reply-To: <003501c6ab05$a4978f20$74304c93@eddy> (Guoping Zhang's message of "Wed, 19 Jul 2006 17:33:34 +1000") Message-ID: <828xmq2gf1.fsf@mid.bfk.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/192 X-Sequence-Number: 20052 * Guoping Zhang: > Thanks for pointing me the cause, but we simply cannot use the COPY FROM > solution. Why not? Just do something like this: CREATE TEMPORARY TABLE tmp (col1 TEXT NOT NULL, col2 INTEGER NOT NULL); COPY tmp FROM STDIN; row1 1 row2 2 ... \. INSERT INTO target SELECT * FROM tmp; If you need some kind of SELECT/INSERT/UPDATE cycle, it's far more complex, of course, and I'm not quite happy with what I'm using right now. -- Florian Weimer BFK edv-consulting GmbH http://www.bfk.de/ Durlacher Allee 47 tel: +49-721-96201-1 D-76131 Karlsruhe fax: +49-721-96201-99