Re: Is this expected concurrency behaviour for EvalPlanQual and ctid?

Поиск
Список
Период
Сортировка
От Bernice Southey
Тема Re: Is this expected concurrency behaviour for EvalPlanQual and ctid?
Дата
Msg-id CAEDh4nx9Hx_pm4rCvGhWjgzy_w9qR7Ydiha+D4mchddHZPft7A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Is this expected concurrency behaviour for EvalPlanQual and ctid?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Wed, Nov 19, 2025 at 8:04 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> > The same thing happens with
> > update t set  i = 2 from (select i from t for update) x where t.i = x.i;
>
> Right, the common advice if you need to make such scenarios work
> is to add FOR UPDATE to the non-target relations.  But here, that
> just breaks in the opposite direction: the sub-select blocks
> waiting for the concurrent commit and then returns x.i = 2.
> But the UPDATE's initial scan of t only sees t.i = 1, so the join
> fails before we ever get to EvalPlanQual.

Thanks for the clear explanation. When I tried to think this through I
couldn't fill in the details.



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