Re: A transaction in transaction? Possible?

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: A transaction in transaction? Possible?
Дата
Msg-id 20041110062510.GA54426@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: A transaction in transaction? Possible?  (sad <sad@bankir.ru>)
Ответы Re: A transaction in transaction? Possible?
Список pgsql-sql
On Wed, Nov 10, 2004 at 09:23:02AM +0300, sad wrote:
> On Tuesday 09 November 2004 18:24, Theodore Petrosky wrote:
> > I thought nested transactions are available in the new
> > release (8) coming up.
> 
> how to commit/rollback them ?

CREATE TABLE person (id SERIAL PRIMARY KEY, name TEXT NOT NULL);

BEGIN;
INSERT INTO person (name) VALUES ('Tom');
SAVEPOINT foo;
INSERT INTO person (name) VALUES ('Dick');
ROLLBACK TO foo;
INSERT INTO person (name) VALUES ('Harry');
COMMIT;

SELECT * FROM person;id | name  
----+------- 1 | Tom 3 | Harry
(2 rows)

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


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

Предыдущее
От: sad
Дата:
Сообщение: Re: A transaction in transaction? Possible?
Следующее
От: "Riccardo G. Facchini"
Дата:
Сообщение: Re: A transaction in transaction? Possible?