Re: Strange result using transactions

Поиск
Список
Период
Сортировка
От Matthijs Melissen
Тема Re: Strange result using transactions
Дата
Msg-id 030301c7705c$895ec4e0$5ee26191@Matthijs
обсуждение исходный текст
Ответ на Strange result using transactions  ("Matthijs Melissen" <melissen@phil.uu.nl>)
Ответы Re: Strange result using transactions  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-general
Alban Hertroys wrote:
> Pavan Deolasee wrote:
>> 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'.

> Not necessarily so. I'd expect only to see a successful delete in txn
> 2 if a record with id = 20 existed prior to the beginning of txn 1.

That is exactly the problem. Sorry for not being clear about that.
I get DELETE 0 even if a record with id=20 already exists before both
transactions.


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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: Strange result using transactions
Следующее
От: Denis Gasparin
Дата:
Сообщение: Query that does not use indexes