Re: Question about SELECT FOR UPDATE in transaction, isolation level

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question about SELECT FOR UPDATE in transaction, isolation level
Дата
Msg-id 4331.987178942@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Question about SELECT FOR UPDATE in transaction, isolation level  (Al <alexm%innocent.com@news.tht.net>)
Список pgsql-general
Al <alexm%innocent.com@news.tht.net> writes:
> begin work;
> select val from ids where cntr='ct1' for update;
> update ids set val=val+(some integer value) where cntr='ct1';
> commit work;

Looks reasonable.

> However, when I run everything except the commit on one terminal and
> then run up to and including the select on another terminal, I receive
> the OLD, non-updated value for val on that second terminal. In other
> words, the select is not blocked and the id is not unique.

Hm, it works for me.  You sure you remembered to use select FOR UPDATE
in both transactions?

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: updates way slower than selects?
Следующее
От: "Justin S."
Дата:
Сообщение: Shared memory failure?