CREATE GROUP
Description
Creates a user group.
Precautions
CREATE GROUP is an alias for CREATE ROLE, and it is not a standard SQL syntax and not recommended. Users can use CREATE ROLE directly.
Syntax
CREATE GROUP group_name [ [ WITH ] option [ ... ] ] { PASSWORD | IDENTIFIED BY } { 'password' [ EXPIRED ] | DISABLE };
The syntax of the option clause (optional) is as follows:
{SYSADMIN | NOSYSADMIN}
| {MONADMIN | NOMONADMIN}
| {OPRADMIN | NOOPRADMIN}
| {POLADMIN | NOPOLADMIN}
| {AUDITADMIN | NOAUDITADMIN}
| {CREATEDB | NOCREATEDB}
| {USEFT | NOUSEFT}
| {CREATEROLE | NOCREATEROLE}
| {INHERIT | NOINHERIT}
| {LOGIN | NOLOGIN}
| {REPLICATION | NOREPLICATION}
| {PERSISTENCE | NOPERSISTENCE}
| CONNECTION LIMIT connlimit
| VALID BEGIN 'timestamp'
| VALID UNTIL 'timestamp'
| USER GROUP 'groupuser'
| NODE GROUP logic_cluster_name
| IN ROLE role_name [, ...]
| IN GROUP role_name [, ...]
| ROLE role_name [, ...]
| ADMIN role_name [, ...]
| USER role_name [, ...]
| DEFAULT TABLESPACE tablespace_name
| PROFILE DEFAULT
| PROFILE profile_name
| PGUSER
Parameters
See Parameters in section "CREATE ROLE."
Examples
-- Create a user group. m_db=# CREATE GROUP super_users WITH PASSWORD "********"; -- Create a user. m_db=# CREATE ROLE lche WITH PASSWORD "********"; -- Create a user. m_db=# CREATE ROLE jim WITH PASSWORD "********"; -- Add users to a user group. m_db=# ALTER GROUP super_users ADD USER lche, jim; -- Remove users from a user group. m_db=# ALTER GROUP super_users DROP USER jim; -- Change the name of a user group. m_db=# ALTER GROUP super_users RENAME TO normal_users; -- Delete the user. m_db=# DROP ROLE lche, jim; -- Delete the user group. m_db=# DROP GROUP normal_users;
Helpful Links
ALTER GROUP, DROP GROUP, and CREATE ROLE
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