Re: updateable cursors & visibility

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: updateable cursors & visibility
Дата
Msg-id 20800.1048544196@sss.pgh.pa.us
обсуждение исходный текст
Ответ на updateable cursors & visibility  (Neil Conway <neilc@samurai.com>)
Список pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> - if the user updates a row X in the cursor, then rewinds the cursor and
> fetches X again, should they see the new X or the old X?

If it's considered an insensitive cursor, I'd think it should see the
old X.  You would have a hard time making the code do otherwise in any
case --- the cursor's snapshot is frozen when the cursor is created.

> - if the user updates a row X in the cursor, and then a query within the
> cursor's transaction views X, should the query see new X or old X?

The subsequent query (if it's not going through the cursor) should and
will see the new X.

This should all be handled for you by the command-counter-based
visibility rules; I don't think you need to worry about it.
        regards, tom lane



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

Предыдущее
От: Neil Conway
Дата:
Сообщение: updateable cursors & visibility
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: DEFAULT in