ROLLBACK TO SAVEPOINT
Description
This command will roll back all commands that were executed after the savepoint was established. The savepoint remains valid and can be rolled back to again later, if needed.
implicitly destroys all savepoints that were established after the named savepoint.
WORK
TRANSACTION
The name of a savepoint to roll back to.
Notes
Use RELEASE SAVEPOINT
to destroy a savepoint without discarding the effects of commands executed after it was established.
Specifying a savepoint name that has not been established is an error.
To undo the effects of the commands executed after was established:
ROLLBACK TO SAVEPOINT my_savepoint;
Cursor positions are not affected by a savepoint rollback:
column
1
column
2
Compatibility
The SQL standard specifies that the key word SAVEPOINT
is mandatory, but HAWQ (and Oracle) allow it to be omitted. SQL allows only WORK
, not TRANSACTION
, as a stopword after ROLLBACK
. Also, SQL has an optional clause which is not currently supported by HAWQ. Otherwise, this command conforms to the SQL standard.