Re: Strange result using transactions

Поиск
Список
Период
Сортировка
От Pavan Deolasee
Тема Re: Strange result using transactions
Дата
Msg-id 2e78013d0703270209j3e5c844cw17edc92f2a5b7ae7@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Strange result using transactions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Strange result using transactions  (Alban Hertroys <alban@magproductions.nl>)
Список pgsql-general

On 3/27/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"Matthijs Melissen" <melissen@phil.uu.nl> writes:
> I am executing the following queries (id has a unique key):
> 1) begin;
> 1) delete from forum where id = 20;
> 1) insert into forum (id, name) values (20, 'test');
> 2) delete from forum where id = 20;
> 1) commit;

> The problem is that process 2 gets the message 'DELETE 0'. I would expect
> him to get the message 'DELETE 1'.

Why do you find that strange?  Process 1 hasn't committed its insert yet.


I think what he is saying that *after* txn 1 commits, txn 2 does not see the
record inserted by txn1. Isn't that a fair point ? I mean txn 2 can see the
DELETE operation of txn 1, but can not see the INSERT operation of the
same transaction.

Thanks,
Pavan

--

EnterpriseDB     http://www.enterprisedb.com

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

Предыдущее
От: "Shoaib Mir"
Дата:
Сообщение: Re: VACUUM ANALYZE
Следующее
От: "Dmitry Koterov"
Дата:
Сообщение: Re: Temporarily disable all table indices