DCL Syntax Overview

Data control language (DCL) is used to create users and roles and set or modify database users or role rights.

SHOW

openGauss can use the SHOW command to display various object information. For details about the involved SQL statements, see Table 1.

Table 1 SQL statements related to SHOW

Function

Related SQL Statement

Display index information.

SHOW INDEX

Display the current permission information list.

SHOW PRIVILEGES

Query the information about the current external connection (or internal thread).

SHOW PROCESSLIST

Display the statement for creating a table.

SHOW-CREATE-TABLE

Display the statement for creating a function.

SHOW-CREATE-FUNCTION

Display the statement for creating a stored procedure.

SHOW-CREATE-PROCEDURE

Display the statement for creating a database.

SHOW-CREATE-DATABASE

Display the statement for creating a trigger.

SHOW-CREATE-TRIGGER

Display the statement for creating a view.

SHOW-CREATE-VIEW

Query GUC parameters.

SHOW-VARIABLES

Display the user permission information in openGauss.

SHOW GRANTS

Display information about storage functions.

SHOW FUNCTION STATUS

Display the information about the stored procedure.

SHOW PROCEDURE STATUS

Display information about the trigger.

SHOW TIRRGER

GRANT

The openGauss allows you to run the GRANT command to grant various permissions. For details about the involved SQL statements, see Table 2.

Table 2 SQL statements related to GRANT

Function

Related SQL Statement

Grant permission to create indexes.

GRANT INDEX

Grant permission to modify functions and procedures.

GRANT ALTER ROUTINE

Grant permission to create functions and procedures.

GRANT CREATE ROUTINE

Grant permission to create temporary tables.

GRANT CREATE TEMPORARY TABLES

Gran permission to the current user to create a user.

GRANT CREATE USER

Grant permission to create tablespaces.

GRANT CREATE TABLESPACE

Grant the proxy permission.

GRANT PROXY

REVOKE

openGauss allows you to run the REVOKE command to revoke various permissions. For details about the involved SQL statements, see Table 3.

Table 3 SQL statements related to REVOKE

Function

Related SQL Statement

Revoke permission to create indexes.

REVOKE INDEX

Revoke permission to modify functions and procedures.

REVOKE ALTER ROUTINE

Revoke permission to create functions and procedures.

REVOKE CREATE ROUTINE

Revoke permission to create temporary tables.

REVOKE CREATE TEMPORARY TABLES

Revoke permission to the current user to create a user.

REVOKE CREATE USER

Revoke permission to create tablespaces.

REVOKE CREATE TABLESPACE

Revoke the proxy permission.

REVOKE PROXY

KILL

openGauss allows you to run the KILL command to terminate a specified connection or SQL statements executed under the connection. The following table lists the related SQL statements.

Table 4 SQL statements related to KILL

Function

Related SQL Statement

Terminate a specified connection or an SQL statement executed under the connection.

KILL

SET PASSWORD

openGauss allows you to run the SET PASSWORD command to change the user password. The following table lists the related SQL statements.

Table 5 SQL statements related to SET PASSWORD

Function

Related SQL Statement

Change the user password.

SET PASSWORD

Feedback
编组 3备份
    openGauss 2024-05-19 00:42:09
    cancel