Fetch from refcursor and transactions

From: aasat <satriani(at)veranet(dot)pl>
To: pgsql-general(at)postgresql(dot)org
Subject: Fetch from refcursor and transactions
Date: 2011-12-23 13:13:45
Message-ID: 1324646025312-5097158.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have question about fetching data from refcursor, why this operation
required to be inside transaction?

for example

with transaction

begin;
select * from foo();
fetch all from "<unnamed portal 1>";
commit;

when I try this without transaction I get error

select * from foo();
fetch all from "<unnamed portal 1>";

ERROR: cursor "<unnamed portal 1>" does not exist

why cursor "<unnamed portal 1>" are not defined in session and required
transaction?

best regards,
Wojciech

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Fetch-from-refcursor-and-transactions-tp5097158p5097158.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Aman Gupta 2011-12-23 13:33:14 postgresql triggers - defining a global resource (java)
Previous Message Clemens Eisserer 2011-12-23 09:58:38 Re: Initdb fails on openwrt in "creating template1 database"