DDL Syntax Overview
Data definition language (DDL) is used to define or change an object in a database, such as a table, an index, or a view.
M compatibility does not support DDL operations when the CN is incomplete. For example, if a CN in the cluster is faulty, creating a database or a table will fail.
Defining a Role
A role is used to manage permissions. For database security, management and operation permissions can be granted to different roles. Table 1 lists the involved SQL statements.
Defining a User
A user is used to log in to a database. Different permissions can be granted to users for managing data accesses and operations of the users. Table 2 lists the involved SQL statements.
Defining a Database or Schema
In M compatibility, database and schema are synonyms. A database or schema is the warehouse for organizing, storing, and managing data. Defining a database includes: creating a database, altering the database attributes, and dropping the database. Table 3 lists the involved SQL statements.
Defining a Table
A table is a special data structure in a database and is used to store data objects and relationship between data objects. Table 4 lists the involved SQL statements.
Defining a Partitioned Table
A partitioned table is a logical table used to improve query performance and does not store data (data is stored in ordinary tables). Table 5 lists the involved SQL statements.
Defining an Index
An index indicates the sequence of values in one or more columns in a database table. It is a data structure that improves the speed of data access to specific information in a database table. Table 6 lists the involved SQL statements.
Defining a Plug-in Extension
This feature is for internal use only. You are advised not to use it.
|
Function |
SQL Statement |
|---|---|
|
Creating a plug-in extension |
|
|
Modifying a plug-in extension |
|
|
Dropping a plug-in extension |
Defining a User Group
|
Function |
SQL Statement |
|---|---|
|
Creating a user group |
|
|
Modifying attributes of a user group |
|
|
Deleting a user group |
Defining a Node
|
Function |
SQL Statement |
|---|---|
|
Creating a cluster node |
|
|
Modifying the definition of an existing node |
|
|
Deleting a node |
Defining a Node Group
|
Function |
SQL Statement |
|---|---|
|
Creating a cluster node group |
|
|
Modifying information about an existing node group |
|
|
Deleting a node group |
Defining a Sequence
|
Function |
SQL Statement |
|---|---|
|
Adding a sequence to the current database |
|
|
Modifying parameters of an existing sequence |
|
|
Deleting a sequence from the current database |
Defining a Resource Label
|
Function |
SQL Statement |
|---|---|
|
Creating a resource label |
|
|
Altering a resource label |
|
|
Dropping a resource label |
Defining an Audit Policy
|
Function |
SQL Statement |
|---|---|
|
Creating a unified audit policy |
|
|
Altering a unified audit policy |
|
|
Dropping an audit policy |
Defining a View
|
Function |
SQL Statement |
|---|---|
|
Creating a view |
|
|
Modifying the auxiliary attributes of a view |
|
|
Forcibly deleting a view from the database |
Defining a Function
|
Function |
SQL Statement |
|---|---|
|
Creating a function |
|
|
Deleting a function |
Setting the nodeis_active Column of a Specified Node
ALTER COORDINATOR describes how to change the value of the nodeis_active column of a specified node in the pgxc_node system catalog.
Collecting Statistics
For details about how to collect statistics related to the contents of ordinary tables in the database, see ANALYZE.
Clearing a Recycle Bin
M compatibility provides statements for clearing a recycle bin. For details, see PURGE.
Defining an Object Comment
M compatibility supports statements for defining or modifying an object comment. For details, see COMMENT.
Creating a Table Based on Query Results
M compatibility supports statements for creating a table based on query results and inserting queried data into the target table. For details, see SELECT INTO.
Clearing Table Data
M compatibility supports statements for quickly deleting all rows from a table. For details, see TRUNCATE.
Recycling Storage Space
M compatibility supports statements for recycling storage space occupied by deleted rows in a table or B-tree index. For details, see VACUUM.
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