Топ-100
 

ROLLBACK TO SAVEPOINT

RDBMS Type: PostgreSQL
Topic

ROLLBACK [ WORK | TRANSACTION ] TO [ SAVEPOINT ] savepoint_name

Example

BEGIN;

DECLARE foo CURSOR FOR SELECT 1 UNION SELECT 2;

SAVEPOINT foo;

FETCH 1 FROM foo;
?column?
----------
1

ROLLBACK TO SAVEPOINT foo;

FETCH 1 FROM foo;
?column?
----------
2

COMMIT;