Re: what makes the PL cursor life-cycle must be in the same transaction?

Поиск
Список
Период
Сортировка
От Andy Fan
Тема Re: what makes the PL cursor life-cycle must be in the same transaction?
Дата
Msg-id CAKU4AWq88RjVc68VV5MvynPhT7j9OkkPVmSKw+OfdUbA_HQHLA@mail.gmail.com
обсуждение исходный текст
Ответ на what makes the PL cursor life-cycle must be in the same transaction?  (Andy Fan <zhihui.fan1213@gmail.com>)
Список pgsql-hackers
DECLARE cur CURSOR with hold FOR SELECT * FROM t;

the "with hold"  is designed for this purpose.  sorry for this interruption. 

On Sun, Mar 10, 2019 at 4:14 PM Andy Fan <zhihui.fan1213@gmail.com> wrote:
for example:
begin;
declare cur cursor for select * from t;
insert into t2 values(...);
fetch next cur;
commit;

// after this,  I can't fetch cur any more. 

My question are:
1.  Is this must in principle?  or it is easy to implement as this in PG?
2.  Any bad thing would happen if I keep the named portal (for the cursor) available even the transaction is commit, so that I can fetch the cursor after the transaction is committed?  

Thanks  

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: pgsql: Removed unused variable, openLogOff.
Следующее
От: "Imai, Yoshikazu"
Дата:
Сообщение: RE: speeding up planning with partitions