Re: Queries getting older values (autocommit enabled)

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Queries getting older values (autocommit enabled)
Дата
Msg-id CAKFQuwZmBiugpSwBGkHN_pTYgpFTkxfnMf-xCA8xuVpdj+TT8Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Queries getting older values (autocommit enabled)  (Eudald Valcàrcel Lacasa <eudald.valcarcel@gmail.com>)
Список pgsql-bugs
On Sat, Apr 25, 2020 at 12:44 PM Eudald Valcàrcel Lacasa <eudald.valcarcel@gmail.com> wrote:
Hello David,
Thanks for your answer.
The actual problem is that my SELECT query is being executed meanwhile the UPDATE one, but instead of waiting for the UPDATE to be executed, it doesn't wait and gets the value from the field prior to the update.
I believed it was because of the MVCC, and I was looking for a workaround to force the select to wait for the UPDATE to finish, instead of taking values of a snapshot.


If you can demonstrate a case where session 1 is holding a transaction open on a completed UPDATE statement and session 2 with a SELECT FOR UPDATE is not waiting for session 1 to commit I am pretty sure you will be demonstrated a bug.

"conversely, SELECT FOR UPDATE will wait for a concurrent transaction that has run any of those commands on the same row, and will then lock and return the updated row (or no row, if the row was deleted)."


David J.
 

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

Предыдущее
От: Eudald Valcàrcel Lacasa
Дата:
Сообщение: Re: Queries getting older values (autocommit enabled)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16390: Regression between 12.2 and 11.6 on a recursive query : very slow and overestimation of rows