Thread: Transactions

Transactions

From
Luiz Eduardo Cantanhede Neri
Date:
What happens if I open 2 or more transactions?

BEING;
--SOME COMMANDS
BEGIN;
--SOME OTHERS COMMANDS
ROLLBACK;
BEGIN;
--EVEN MORE COMMANDS
COMMIT;
--ALMOST DONE WITH COMMANDS
COMMIT;

one internal commit / rollback affects the most outside transaction?

Re: Transactions

From
Tom Lane
Date:
Luiz Eduardo Cantanhede Neri <lecneri@gmail.com> writes:
> What happens if I open 2 or more transactions?

Nothing, because you can't.

Read up on savepoints, which are effectively subtransactions.

            regards, tom lane