X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id EC336D1B182 for ; Fri, 21 May 2004 10:56:36 -0300 (ADT) 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 72807-02 for ; Fri, 21 May 2004 10:56:20 -0300 (ADT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.184]) by svr1.postgresql.org (Postfix) with ESMTP id 3B185D1BAAE for ; Fri, 21 May 2004 10:56:16 -0300 (ADT) Received: from [212.227.126.205] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1BRAVY-0003OL-00; Fri, 21 May 2004 15:56:20 +0200 Received: from [217.95.140.254] (helo=fam-meskes.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1BRAVX-0003Sq-00; Fri, 21 May 2004 15:56:19 +0200 Received: from feivel (feivel.fam-meskes.de [172.26.14.14]) by fam-meskes.de (Postfix) with ESMTP id 574B510EF47; Fri, 21 May 2004 15:56:53 +0200 (CEST) Received: by feivel (Postfix, from userid 1000) id 6D3794AC9D; Fri, 21 May 2004 15:56:18 +0200 (CEST) Date: Fri, 21 May 2004 15:56:18 +0200 From: Michael Meskes To: wespvp@syntegra.com Cc: pgsql-interfaces@postgresql.org Subject: Re: ECPG multiple INSERTS or SELECTS in one command? Message-ID: <20040521135618.GD14285@1> Mail-Followup-To: wespvp@syntegra.com, pgsql-interfaces@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:da5cff6069dd6897c77170232368d0ba X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/26 X-Sequence-Number: 4918 On Sun, May 09, 2004 at 06:36:44PM -0500, wespvp@syntegra.com wrote: > A (different) Pro*C program I recently ported from Oracle to PostgreSQL > showed this difference. In Pro*C you can load an array with rows to insert, > then issue a single INSERT request passing it the array. I believe the same > thing applies to FETCH. As far as I can tell, in PostgreSQL ecpg (or other) > you have to execute one request per record. The program SEGV'd all over the > place when I tried to use the Pro*C array code. I had to do a major rework > of the code to remove the array logic. That is for insert right? Batching inserts is tricky as there is no way for ecpg to see if your array of 10 ints shall be inserted as 10 ints or as one array. With fetch on the other hand it should work the same as with Pro*C. There is no problem to fetch into an array. Michael -- Michael Meskes Email: Michael at Fam-Meskes dot De ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!