Syntax

Alter user name
ALTER USER user_name
    RENAME TO new_user_name

Alter user properties
CREATE USER user_name [ [ WITH ] system_permission [ ... ]['PASSWORD' { password | NULL }] ];

Alter user authentication method
ALTER USER user_name WITH oauth (
  jwks_url = 'xxx.com',
  issuer = 'risingwave',
  other_params_should_match = 'xxx',
);

Parameters

Parameter or clauseDescription
user_nameThe name of the user to be modified.
new_user_nameThe new name of the user.
system_permissionSee the options for system permissions of the CREATE USER command.

For the alter user authentication method, the jwks_url and issuer parameters are mandatory. On the other hand, other_params_should_match is an optional parameter that will be validated against jwt.claims. Ensure that all keys in the options are in lowercase.

NOTE

kid and alg are required in the header of JWT, and kid is also required in the JWKs returned by the JWKS server. All parameters set in user creation (except jwks_url) will be checked in the claims of JWT. Any mismatch will deny the login process.

Examples

The following statement renames the user user1 to user001.

ALTER USER user1 RENAME TO user001;

The following statement modifies the password and privileges of user001.

ALTER USER user001 NOSUPERUSER CREATEDB PASSWORD '4d2Df1ee5';