Alvaro, > I have a better question: do we allow SAVEPOINT (i.e. to establish a > savepoint, i.e. to open a nested transaction) within an aborted > transaction block?
My opinion? No. I would personally not want to allow it. > My opinion is that we should disallow both SAVEPOINT and RELEASE when in > an aborted transaction block. Only ROLLBACK TO, ROLLBACK and COMMIT > would be allowed. I agree. > In this scenario, ROLLBACK TO would always return to > a non-aborted transaction state, or the target savepoint would not > exist and the state would remain the same. This is also good. From my perspective, as a builder of some *very* database-centric applications, if one has an abort contidition that proceeds to try to establish a Savepoint as if the abort didn't exist then one needs to do some debugging. I'm sorry I missed the original discussion on this or I would have expressed this opinion earlier. For that matter: begin; savepoint; select 0/0; -- abort savepoint; -- commands will be ignored select 1; -- commands will be ignored release; -- commands will be ignored release; -- abort main xact 'cause we didn't rollback commit; -- abort message Is the above more or less correct, Alvaro? -- -Josh Berkus Aglio Database Solutions San Francisco ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend