Re: COMMIT in PostgreSQL

Поиск
Список
Период
Сортировка
От Susan Lane
Тема Re: COMMIT in PostgreSQL
Дата
Msg-id aha3jv$1c2v$1@news.hub.org
обсуждение исходный текст
Ответ на Re: COMMIT in PostgreSQL  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-general
Thanks!

""scott.marlowe"" <scott.marlowe@ihs.com> wrote in message
news:Pine.LNX.4.44.0207191529000.4638-100000@css120.ihs.com...
> On Fri, 19 Jul 2002, Susan Lane wrote:
>
> > I have noticed this difference between Postgres and Oracle as well.  I
> > wonder if there is a rollback mechanism as there is in Oracle.  I mean
if
> > you use a BEGIN, can you rollback in Postgres?
>
> Yes.  If you do the following:
>
> begin;
> select * from table1;
> update table2 set field1='yada' where id=1234;
> delete from table3 where id=1243;
> insert into table4 (fielda, fieldb) values ('hello',45);
> rollback;
>
> Then all the changes (except for sequence counters being incremented) will
> be rolled back.
>
> Note that if you do:
>
> begin;
> select * from ;
> insert into table (name) values('me');
> commit;
>
> The insert will fail because you had a failure in your select query.
> Unlike many other databases where data change failures are the only ones
> to automatically rollback a transaction, in postgresql, almost any error
> in a transaction will cause it to rollback.
>
> Note that postgresql does NOT support nested transactions either.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)



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

Предыдущее
От: "Susan Lane"
Дата:
Сообщение: Re: Modifying column size
Следующее
От: Tom Lane
Дата:
Сообщение: Re: brk() function and performance