Overview
transaction_read_only specifies whether to allow only read-only transactions.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can use theSHOW VARIABLESstatement and theinformation_schema.GLOBAL_VARIABLESview to view the values of global system variables.Session level
Both the
systenant and all user tenants can use theSHOW VARIABLESstatement and theinformation_schema.SESSION_VARIABLESview to view the values of session system variables.
Modify variables
Global effective
The
systenant can directly modify the values of global system variables.The user tenant must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
Session expiration
The
systenant and all user tenants can directly modify the values of session system variables for their own tenants.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Bool |
| Default Value | False |
| Value range |
|
| Effective Scope |
|
| Modifiable | Yes, you can use theSETStatement modification. |
Usage instructions
When transaction_read_only is set to True, DML statements are not allowed.
Configuration example
Sets whether to allow non-read-only transactions.
Session effective
obclient> SET transaction_read_only = False;Effective globally
obclient> SET GLOBAL transaction_read_only = False;