Re: nested transactions - Mailing list pgsql-hackers

From Kevin Brown
Subject Re: nested transactions
Date
Msg-id 20021210032028.GB20203@filer
Whole thread Raw
In response to nested transactions  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: nested transactions
List pgsql-hackers
Bruce Momjian wrote:
> I am going to work on nested transactions for 7.4.
> 
> My goal is to first implement nested transactions:
> 
>     BEGIN;
>     SELECT ...
>     BEGIN;
>     UPDATE;
>     COMMIT;
>     DELETE;
>     COMMIT;
> 
> and later savepoints (Oracle):
> 
> 
>     BEGIN;
>     SELECT ...
>     SAVEPOINT t1;
>     UPDATE;
>     SAVEPOINT t2;
>     DELETE;
>     ROLLBACK TO SAVEPOINT t2;
>     COMMIT;
> 
> I assume people want both.

Yep.

My question is: how do you see cursors working with nested
transactions?

Right now you can't do cursors outside of transactions.
Subtransactions would complicate things a bit:

BEGIN;
DECLARE CURSOR x ...
BEGIN
(is cursor x visible here?  What are the implications of using it if
it is?)
...
COMMIT;
...
COMMIT;


Would we only allow cursors within the innermost transactions?  If we
allow them anywhere else, why retain the requirement that they be used
within transactions at all?


-- 
Kevin Brown                          kevin@sysexperts.com


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: DB Tuning Notes for comment...
Next
From: Bruce Momjian
Date:
Subject: Re: nested transactions