Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name
Дата
Msg-id 11085.1153754764@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name  ("Florian G. Pflug" <fgp@phlo.org>)
Ответы Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name  ("Florian G. Pflug" <fgp@phlo.org>)
Список pgsql-hackers
"Florian G. Pflug" <fgp@phlo.org> writes:
> Couldn't this be emulated by doing
> begin;
> declare foo cursor for select * from bar for update;
> fetch foo into v_foo ;
> update bar set abc='def' where ctid = v_foo.ctid;

That wouldn't follow the expected semantics if there's a concurrent
update, because the updated row would always fail the WHERE clause,
and thus the update would just silently not happen.  (I'm thinking
about READ COMMITTED mode of course --- in SERIALIZABLE you'd just get
the expected error.)  You'd have to find some way to pump the row's most
up-to-date version through the cursor's query plan, a la EvalPlanQual,
to see if it still met the cursor's WHERE condition.
        regards, tom lane


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

Предыдущее
От: Rod Taylor
Дата:
Сообщение: Re: Better name/syntax for "online" index creation
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name