Help Center/
GaussDB/
Developer Guide(Centralized_3.x)/
SQL Reference/
SQL Syntax/
ROLLBACK PREPARED
Updated on 2024-05-07 GMT+08:00
ROLLBACK PREPARED
Function
ROLLBACK PREPARED cancels a transaction ready for two-phase committing.
Precautions
- The function is only available in maintenance mode (when the GUC parameter xc_maintenance_mode is set to on). Exercise caution when enabling the mode. It is used by maintenance engineers for troubleshooting. Common users should not use the mode.
- Only the user that initiates a transaction or the system administrator can roll back the transaction.
- The transaction function is maintained automatically by the database, and should be not visible to users.
Syntax
ROLLBACK PREPARED transaction_id ;
Parameter Description
transaction_id
Specifies the identifier of the transaction to be committed. The identifier must be different from those for current prepared transactions.
Examples
-- Start. gaussdb=# BEGIN; BEGIN -- Prepare a transaction whose identifier is trans_test. gaussdb=# PREPARE TRANSACTION 'trans_test'; PREPARE TRANSACTION -- Cancel the transaction whose identifier is trans_test. gaussdb=# ROLLBACK PREPARED 'trans_test'; ROLLBACK PREPARED
Helpful Links
Parent topic: SQL Syntax
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.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot