Cloud

CREATE USER

The CREATE USER statement creates a new user in Redpanda SQL. CREATE ROLE is a synonym for CREATE USER, provided for PostgreSQL compatibility. Only a superuser can run this statement.

A password is required when creating a user.

Error messages from the SQL engine refer to users as "roles" (for example, role "alice@example.com" does not exist). This is consistent with PostgreSQL terminology and refers to the same object that CREATE USER produces.

On Redpanda Cloud BYOC, users are provisioned automatically when a Redpanda Cloud user or service account is assigned a role with the SQL: Access or SQL: Manage permission. CREATE USER works syntactically, but the Cloud operator revokes CONNECT access for any user not present in Redpanda Cloud’s organization IAM. Manage user lifecycle through Redpanda Cloud IAM instead. See Manage access to Redpanda SQL.

Syntax

CREATE { USER | ROLE } user_name [WITH] PASSWORD 'password' [SUPERUSER | NOSUPERUSER];
  • user_name: Name of the new user. Cannot be CURRENT_USER or CURRENT_ROLE.

  • PASSWORD 'password': Required. The password must be a non-empty string literal.

  • SUPERUSER: Optional. Grants superuser privileges to the new user. Superusers bypass authorization checks.

  • NOSUPERUSER: Optional. Explicitly marks the user as a non-superuser. Default when neither SUPERUSER nor NOSUPERUSER is specified.

  • WITH: Optional. Has no effect; provided for PostgreSQL compatibility.

Examples

Create a regular user with a password:

CREATE USER "alice@example.com" WITH PASSWORD 'secret123';

Create a superuser:

CREATE USER "admin@example.com" WITH PASSWORD 'admin_secret' SUPERUSER;