Re: Strange result using transactions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Strange result using transactions
Дата
Msg-id 10978.1174966185@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Strange result using transactions  ("Matthijs Melissen" <melissen@phil.uu.nl>)
Ответы Re: Strange result using transactions  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
Список pgsql-general
"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.

            regards, tom lane

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

Предыдущее
От: "Stuart Cooper"
Дата:
Сообщение: Re: Strange result using transactions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Every user has own database - how?