ROLLBACK TO SAVEPOINT
Description
Rolls back to a savepoint. It implicitly destroys all savepoints that were established after the named savepoint.
Rolls back all statements that were executed after the savepoint was established. The savepoint remains valid and can be rolled back to again later, if needed.
Precautions
- Rolling back to a savepoint name that has not been specified is an error.
- Use ROLLBACK TO SAVEPOINT to roll back to a savepoint. Use RELEASE SAVEPOINT to destroy a savepoint but keep the effects of the commands executed after the savepoint was established.
Syntax
ROLLBACK [ WORK | TRANSACTION ] TO [ SAVEPOINT ] savepoint_name;
Parameters
- savepoint_name
Specifies the savepoint to roll back to.
Examples
-- Undo the effects of the statements executed after my_savepoint was established: m_db=# START TRANSACTION; m_db=# SAVEPOINT my_savepoint; m_db=# ROLLBACK TO SAVEPOINT my_savepoint; m_db=# RELEASE SAVEPOINT my_savepoint; m_db=# COMMIT;
Helpful Links
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot