Re: [GENERAL] Does PG support bulk operation in embedded C - Mailing list pgsql-sql

From Joshua D. Drake
Subject Re: [GENERAL] Does PG support bulk operation in embedded C
Date
Msg-id 555BD72A.6070406@commandprompt.com
Whole thread Raw
In response to Re: [GENERAL] Does PG support bulk operation in embedded C  ("Ravi Krishna" <srkrishna@gmx.com>)
Responses Re: [GENERAL] Does PG support bulk operation in embedded C
List pgsql-sql
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.


pgsql-sql by date:

Previous
From: "Ravi Krishna"
Date:
Subject: Re: [GENERAL] Does PG support bulk operation in embedded C
Next
From: Michael Paquier
Date:
Subject: Re: [GENERAL] Does PG support bulk operation in embedded C