Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yus0I-0005zP-HU for pgsql-sql@arkaria.postgresql.org; Wed, 20 May 2015 00:36:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yus0I-0008LO-1W for pgsql-sql@arkaria.postgresql.org; Wed, 20 May 2015 00:36:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yus0H-0008LE-Bu; Wed, 20 May 2015 00:36:57 +0000 Received: from lists.commandprompt.com ([69.168.55.30]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Yus0C-0004oH-Io; Wed, 20 May 2015 00:36:55 +0000 Received: from [192.168.1.3] (spinlock.commandprompt.com [69.168.55.30]) by lists.commandprompt.com (Postfix) with ESMTPA id DE15C281; Tue, 19 May 2015 17:36:45 -0700 (PDT) Received: from [192.168.1.3] ([67.168.169.165] helo=[192.168.1.3]) by assp.commandprompt.com with ESMTPS(AES128-SHA) (2.1.1); 19 May 2015 17:36:45 -0700 Message-ID: <555BD72A.6070406@commandprompt.com> Date: Tue, 19 May 2015 17:36:58 -0700 From: "Joshua D. Drake" Organization: Command Prompt, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Ravi Krishna CC: pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: [GENERAL] Does PG support bulk operation in embedded C References: <8A634A74EF65401FBE09169A72984EBB@RaviLaptop>, <555BD1C6.4000301@commandprompt.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Assp-Version: 2.1.1(11364) on assp.commandprompt.com X-Assp-Client-SSL: yes X-Assp-ID: assp.commandprompt.com m1-82205-07424 X-Assp-Envelope-From: jd@commandprompt.com X-Assp-Intended-For: pgsql-general@postgresql.org X-Assp-Original-Subject: Re: [SQL] [GENERAL] Does PG support bulk operation in embedded C X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 05/19/2015 05:27 PM, Ravi Krishna wrote: > Not sure whether I am understanding this. I checked embedded C and did > not find any section which describes what I have asked, that is the > ability to do multiple inserts, or updates or deletes in one sql call. > For example, if my application does the following > > BEGIN TRANSACTION > INSERT INTO TABLE_A > UPDATE TABLE_B > INSERT INTO TABLE_C > COMMIT TRANSACTION Well PostgreSQL certainly supports the above. > > DB2 provides to combine the three sql operations into an array and make > a call to DB2 which executes the array (that is all 3 sqls as one single > call). You can do this with inserts using multivalue. INSERT INTO TABLE_A VALUES (), (), (); I am not sure about UPDATE or DELETE, I know you can use WITH on DELETE which gives you some flexibility. I don't think you will get a one to one comparison but you should be able to get close. JD -- Command Prompt, Inc. - http://www.commandprompt.com/ 503-667-4564 PostgreSQL Centered full stack support, consulting and development. Announcing "I'm offended" is basically telling the world you can't control your own emotions, so everyone else should do it for you. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql