Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name
Дата
Msg-id 11245.1153755808@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> No, a concurrent vacuum can't change that because vacuum can't change
> the page unless it can get a super-exclusive lock on it (which means
> nobody else can have a scan stopped at that page, which is exactly
> what this cursor has).

More to the point, vacuum certainly may not delete a row that's still
visible to any open transaction, which this row would be by definition.
And VACUUM FULL couldn't move it, because it couldn't get exclusive
lock on the table.

You'd probably have to forbid use of WHERE CURRENT for a cursor WITH HOLD
though, since that quite possibly would contain rows that don't exist
anymore.
        regards, tom lane


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

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