Skip to main content

CREATE USER

Use the CREATE USER command to create a new user account in RisingWave.

Syntax

CREATE USER user_name [ [ WITH ] option [ ... ] ];

Parameters

Parameter or clauseDescription
user_nameThe name of the user account to be created.
WITH optionSee the table below.

WITH options

OptionDescription
  • SUPERUSER
  • NOSUPERUSER
Grants/denies the user superuser permission. A superuser can override all access restrictions.
NOSUPERUSER is the default value.
  • CREATEDB
  • NOCREATEDB
Grants/denies the user the ability to create databases.
NOCREATEDB is the default value.
  • CREATEUSER
  • NOCREATEUSER
Grants/denies the user the ability to create new users and/or alter and drop existing users.
NOCREATEUSER is the default value.
  • LOGIN
  • NOLOGIN
Grants/denies the user the ability to log in when establishing connection with RisingWave.
LOGIN is the default value.
  • [ ENCRYPTED ] PASSWORD ' password '
  • PASSWORD NULL
Sets the password for the user account. You need to provide the password for authentication when during login.
If you do not want password authentication for the user, omit the PASSWORD option.
Currently, a null password or empty string password means password authentication is not needed.

Example

The following statement creates a user account with the name "user1" and password 'pAssword12345'.

CREATE USER user1
WITH PASSWORD 'pAssword12345';
tip

You can connect to RisingWave with the newly created user account.

To switch to the new user account:

Quit current connection.
\q
Connect and log in with the new account.
psql -h localhost -p 4566 -d dev -U user1

Enter the password to log in.

note

Names and unquoted identifiers are case-insensitive. Therefore, you must double-quote any of these fields for them to be case-sensitive. See also Identifiers.

Help us make this doc better!