agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: john <johnf@jfcomputer.com>
To: pgsql-sql@postgresql.org
Subject: Re: [GENERAL] Does PG support bulk operation in embedded C
Date: Wed, 20 May 2015 06:56:54 -0700
Message-ID: <555C92A6.5000503@jfcomputer.com> (raw)
In-Reply-To: <555BD72A.6070406@commandprompt.com>
References: <8A634A74EF65401FBE09169A72984EBB@RaviLaptop>
<555BD1C6.4000301@commandprompt.com>
<trinity-21edeb52-1d3f-4a62-93c2-9059113edfc7-1432081647362@3capp-mailcom-lxa15>
<555BD72A.6070406@commandprompt.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>
If I'm reading what IBM has on the SQLBulkOperations function correctly
you have to know the size in advance - than does not sound like an
advantage.
Anyway, taking the function name 'bulk' into account - I think you want
find the best way to to insert a large number of row/records.
Review the 'copy' command to populate a database:
http://www.postgresql.org/docs/9.1/static/populate.html - read
carefully as it will increase performance in a dramatic way.
update and delete - well even in DB2 you are still doing the same thing
as Postgres - the only difference is it's handled without sending the
command. Whatever, the overhead - it's very small.
Johnf
On 05/19/2015 05:36 PM, Joshua D. Drake wrote:
>
> 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
>
>
>
>
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
view thread (9+ messages) latest in thread
Message-ID: <555C92A6.5000503@jfcomputer.com>
Permalink: ../555C92A6.5000503@jfcomputer.com/
Also on: postgresql.org/message-id/555C92A6.5000503@jfcomputer.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: johnf@jfcomputer.com
Subject: Re: [GENERAL] Does PG support bulk operation in embedded C
In-Reply-To: <555C92A6.5000503@jfcomputer.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox