Re: Cursors and Transactions, why?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Cursors and Transactions, why?
Дата
Msg-id 6930.1081388801@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Cursors and Transactions, why?  (Eric Ridge <ebr@tcdi.com>)
Список pgsql-general
Eric Ridge <ebr@tcdi.com> writes:
> wow.  I should go back and read the archives to see if this was
> discussed already, but I can't help but wonder if there's a way to only
> copy pointers to the tuples.  I realize VACUUM could screw it up, but
> maybe something could be invented (or re-used) to help guard against
> that.

Still looking for that free lunch, eh?

If you want to leave the tuples on-disk, then you hold a transaction
open to ensure that VACUUM won't whisk them out from under you.  That's
what the normal non-HOLD cursor case will do.

If you don't want to leave the tuples on-disk, you have to copy them
someplace.  You can do that with a HOLD cursor.

AFAICS any other solution will simply reinvent one or the other of these
techniques.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to list domains
Следующее
От: Mage
Дата:
Сообщение: eval in plpgsl