From: | john <johnf(at)jfcomputer(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: [GENERAL] Does PG support bulk operation in embedded C |
Date: | 2015-05-20 13:56:54 |
Message-ID: | 555C92A6.5000503@jfcomputer.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-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
>
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2015-05-20 14:05:12 | Re: Slaves show different results for query |
Previous Message | Adrian Klaver | 2015-05-20 13:43:18 | Re: Slaves show different results for query |
From | Date | Subject | |
---|---|---|---|
Next Message | Ravi Krishna | 2015-05-20 15:23:51 | Re: [GENERAL] Does PG support bulk operation in embedded C |
Previous Message | Michael Paquier | 2015-05-20 00:43:53 | Re: [GENERAL] Does PG support bulk operation in embedded C |