Updated on 2025-10-23 GMT+08:00

Overview of Other Syntax

In addition to DCL, DDL, and DML syntax, M-compatible also provides syntax for other functions.

Showing an Execution Plan of an SQL Statement

M compatibility provides statements for showing an execution plan of an SQL statement. For details, see EXPLAIN.

Collecting Table Content Statistics

M compatibility provides statements for collecting statistics about the table content in the database. For details, see ANALYZE.

Clearing the Storage Space

M compatibility provides statements for recycling storage space occupied by deleted rows in a table or B-Tree index. For details, see VACUUM.

Creating a Prepared Statement

M compatibility provides statements for creating a prepared statement. For details, see PREPARE.

Prepared Statements

Table 1 SQL statements related to prepared statements

Function

SQL Statement

Executing a prepared statement

EXECUTE

Deallocating a prepared statement

DEALLOCATE and DROP PREPARE

SQL Statements Related to Transactions

Table 2 SQL statements related to transactions

Function

SQL Statement

Rolling back the current transaction and canceling the changes in the transaction

ROLLBACK

Starting a transaction

BEGIN

SET TRANSACTION

START TRANSACTION

Preparing the current transaction for two-phase commit

PREPARE TRANSACTION

Committing the current transaction

COMMIT

Committing a prepared two-phase transaction

COMMIT PREPARED

Deleting a savepoint previously defined for the current transaction

RELEASE SAVEPOINT

Rolling back to a savepoint

ROLLBACK TO SAVEPOINT

Canceling a transaction ready for two-phase commit

ROLLBACK PREPARED

Creating a savepoint in the current transaction

SAVEPOINT

Setting a checkpoint

CHECKPOINT

Modifying, Displaying, and Restoring a GUC Parameter

Table 3 SQL statements for modifying, displaying, and restoring a GUC parameter

Function

SQL Statement

Modifying a GUC parameter

SET

Showing the current value of a GUC parameter

SHOW

Restoring a GUC parameter to the default value

RESET

Setting a User Identifier

Table 4 SQL statements for setting a user identifier

Function

SQL Statement

Setting the current user identifier of the current session

SET ROLE

Setting the session user identifier and the current user identifier of the current session to a specified user

SET SESSION AUTHORIZATION