---
title: "CREATE GROUP"
url: "https://docs.yugabyte.com/stable/api/ysql/the-sql-language/statements/dcl_create_group/"
---

# CREATE GROUP

Use the CREATE GROUP statement to create a group role. CREATE GROUP is an alias for CREATE ROLE and is used to create a group role.

## Synopsis

Use the CREATE GROUP statement to create a group role. CREATE GROUP is an alias for [CREATE ROLE](/stable/api/ysql/the-sql-language/statements/dcl_create_role "CREATE ROLE") and is used to create a group role.

## Syntax

- [![Grammar Icon](/icons/file-lines.svg)Grammar](#grammar-1)
- [![Diagram Icon](/icons/diagram.svg)Diagram](#diagram-1)

```output.ebnf
create_group ::= CREATE GROUP role_name 
                 [ [ WITH ] role_option [ , ... ] ]

role_option ::= SUPERUSER
                | NOSUPERUSER
                | CREATEDB
                | NOCREATEDB
                | CREATEROLE
                | NOCREATEROLE
                | INHERIT
                | NOINHERIT
                | LOGIN
                | NOLOGIN
                | REPLICATION
                | NOREPLICATION
                | BYPASSRLS
                | NOBYPASSRLS
                | CONNECTION LIMIT connlimit
                | [ ENCRYPTED ] PASSWORD  ' password ' 
                | PASSWORD NULL
                | VALID UNTIL  ' timestamp ' 
                | IN ROLE role_name [ , ... ]
                | IN GROUP role_name [ , ... ]
                | ROLE role_name [ , ... ]
                | ADMIN role_name [ , ... ]
                | USER role_name [ , ... ]
                | SYSID uid
```

#### create\_group

CREATEGROUP[role\_name](/stable/api/ysql/syntax_resources/grammar_diagrams#role-name)WITH,[role\_option](#role-option)

#### role\_option

SUPERUSERNOSUPERUSERCREATEDBNOCREATEDBCREATEROLENOCREATEROLEINHERITNOINHERITLOGINNOLOGINREPLICATIONNOREPLICATIONBYPASSRLSNOBYPASSRLSCONNECTIONLIMIT[connlimit](/stable/api/ysql/syntax_resources/grammar_diagrams#connlimit)ENCRYPTEDPASSWORD password PASSWORDNULLVALIDUNTIL timestamp INROLE,[role\_name](/stable/api/ysql/syntax_resources/grammar_diagrams#role-name)INGROUP,[role\_name](/stable/api/ysql/syntax_resources/grammar_diagrams#role-name)ROLE,[role\_name](/stable/api/ysql/syntax_resources/grammar_diagrams#role-name)ADMIN,[role\_name](/stable/api/ysql/syntax_resources/grammar_diagrams#role-name)USER,[role\_name](/stable/api/ysql/syntax_resources/grammar_diagrams#role-name)SYSID[uid](/stable/api/ysql/syntax_resources/grammar_diagrams#uid)

See [CREATE ROLE](/stable/api/ysql/the-sql-language/statements/dcl_create_role "CREATE ROLE") for more details.

## Examples

- Create a sample group that can manage databases and roles.
  
  ```plpgsql
  yugabyte=# CREATE GROUP SysAdmin WITH CREATEDB CREATEROLE;
  ```

## See also

- [CREATE ROLE](/stable/api/ysql/the-sql-language/statements/dcl_create_role "CREATE ROLE")
- [GRANT](/stable/api/ysql/the-sql-language/statements/dcl_grant "GRANT")
- [REVOKE](/stable/api/ysql/the-sql-language/statements/dcl_revoke "REVOKE")
