Re: Questions about Rollback - after insert, update,

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Questions about Rollback - after insert, update,
Дата
Msg-id 1127418199.30825.76.camel@state.g2switchworks.com
обсуждение исходный текст
Ответ на Questions about Rollback - after insert, update, delete ... operations?  (Emi Lu <emilu@cs.concordia.ca>)
Ответы Re: Questions about Rollback - after insert, update,  (Emi Lu <emilu@cs.concordia.ca>)
Список pgsql-general
On Thu, 2005-09-22 at 14:20, Emi Lu wrote:
> greetings,
>
> I remembered I read something in the mailing list about "*rollback*" a
> while ago. People mentioned that some operations cannot rollback.
> I cannot remember what kinds of perations are not be able to rollback?

create database and drop database cannot be rolled back, since
transactions live within a database.  Used to be that truncate couldn't
be, but I think it can now.

I don't think there are any other commands that can't be rolled back.
Certainly simple DML (data manipulation language) stuff can all be
rolled back now.  It's always been an issue for certain DDL (data
definition language) to be roll backable.  (<-- not a word, but the only
way I can think to say it)

>
> For example,
>
> begin
>     ... ...
>     insert
>     ... ...
>     delete
>     ... ...
>     update
>     ... ...
>
>     /* If any of the above operation failed, we can rollback all the
> above operations? */
>     rollback
>     ... ...
> end
>
>
> Will all "Insert, delete, update" operations rollback if any of the
> operations fails?

Yep.  Unless you set a savepoint, any error will result in all of a
transaction being rolled back.  You don't get a choice, without a save
point.   It will be rolled back.

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

Предыдущее
От: Emi Lu
Дата:
Сообщение: Questions about Rollback - after insert, update, delete ... operations?
Следующее
От: Todd Eddy
Дата:
Сообщение: Replicating new sequences