Re: [GENERAL] Does PG support bulk operation in embedded C

From: "Ravi Krishna" <srkrishna(at)gmx(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Does PG support bulk operation in embedded C
Date: 2015-05-20 00:27:27
Message-ID: trinity-21edeb52-1d3f-4a62-93c2-9059113edfc7-1432081647362@3capp-mailcom-lxa15
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>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<br/>
<br/>
BEGIN TRANSACTION<br/>
&nbsp;&nbsp; INSERT INTO TABLE_A<br/>
&nbsp;&nbsp; UPDATE TABLE_B<br/>
&nbsp;&nbsp; INSERT INTO TABLE_C</div>

<div>COMMIT TRANSACTION</div>

<div><br/>
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).<br/>
<br/>
I am looking for something similar in PG.<br/>
<br/>
thanks</div>

<div>&nbsp;
<div name="quote" style="margin: 10px 5px 5px 10px; padding: 10px 0px 10px 10px; border-left-color: rgb(195, 217, 229); border-left-width: 2px; border-left-style: solid; -ms-word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin: 0px 0px 10px;"><b>Sent:</b>&nbsp;Tuesday, May 19, 2015 at 8:13 PM<br/>
<b>From:</b>&nbsp;&quot;Joshua D. Drake&quot; &lt;jd(at)commandprompt(dot)com&gt;<br/>
<b>To:</b>&nbsp;&quot;Ravi Krishna&quot; &lt;srkrishna(at)gmx(dot)com&gt;, pgsql-sql(at)postgresql(dot)org<br/>
<b>Cc:</b>&nbsp;pgsql-general(at)postgresql(dot)org<br/>
<b>Subject:</b>&nbsp;Re: [SQL] [GENERAL] Does PG support bulk operation in embedded C</div>

<div name="quoted-content"><br/>
On 05/19/2015 04:47 PM, Ravi Krishna wrote:<br/>
&gt;<br/>
&gt; To explain pls refer to this for DB2<br/>
&gt;<br/>
&gt; <a href="http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.apdv.cli.doc/doc/r0002329.html" target="_blank">http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.apdv.cli.doc/doc/r0002329.html</a><br/>
&gt;<br/>
&gt;<br/>
&gt; Essentially in one single sql call, we can do<br/>
&gt; -- Add new rows<br/>
&gt; -- Update a set of rows where each row is identified by a bookmark<br/>
&gt; -- Delete a set of rows where each row is identified by a bookmark<br/>
&gt; -- Fetch a set of rows where each row is identified by a bookmark<br/>
&gt;<br/>
&gt; This gives tremendous performance benefits as the network round trip is<br/>
&gt; avoided for each sql.<br/>
&gt;<br/>
&gt; I am looking for an equivalent of this in PG and C language.<br/>
<br/>
For embedded C, I believe you are looking for:<br/>
<br/>
<a href="http://www.postgresql.org/docs/9.4/static/ecpg.html" target="_blank">http://www.postgresql.org/docs/9.4/static/ecpg.html</a><br/>
<br/>
<br/>
&gt;<br/>
&gt; Thanks.<br/>
&gt;<br/>
&gt;<br/>
&gt;<br/>
<br/>
<br/>
--<br/>
Command Prompt, Inc. - <a href="http://www.commandprompt.com/" target="_blank">http://www.commandprompt.com/</a> 503-667-4564<br/>
PostgreSQL Centered full stack support, consulting and development.<br/>
Announcing &quot;I&#39;m offended&quot; is basically telling the world you can&#39;t<br/>
control your own emotions, so everyone else should do it for you.<br/>
<br/>
<br/>
--<br/>
Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)<br/>
To make changes to your subscription:<br/>
<a href="http://www.postgresql.org/mailpref/pgsql-sql" target="_blank">http://www.postgresql.org/mailpref/pgsql-sql</a></div>
</div>
</div>
</div></div></body></html>

Attachment Content-Type Size
unknown_filename text/html 3.3 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2015-05-20 00:36:58 Re: [GENERAL] Does PG support bulk operation in embedded C
Previous Message Joshua D. Drake 2015-05-20 00:13:58 Re: Does PG support bulk operation in embedded C

Browse pgsql-sql by date

  From Date Subject
Next Message Joshua D. Drake 2015-05-20 00:36:58 Re: [GENERAL] Does PG support bulk operation in embedded C
Previous Message Joshua D. Drake 2015-05-20 00:13:58 Re: Does PG support bulk operation in embedded C