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

Поиск
Список
Период
Сортировка
От john
Тема Re: [GENERAL] Does PG support bulk operation in embedded C
Дата
Msg-id 555C92A6.5000503@jfcomputer.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Does PG support bulk operation in embedded C  ("Joshua D. Drake" <jd@commandprompt.com>)
Ответы Re: [GENERAL] Does PG support bulk operation in embedded C  ("Ravi Krishna" <srkrishna@gmx.com>)
Список 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
>
>
>
>




В списке pgsql-sql по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [GENERAL] Does PG support bulk operation in embedded C
Следующее
От: "Ravi Krishna"
Дата:
Сообщение: Re: [GENERAL] Does PG support bulk operation in embedded C