This topic describes how to create a database account for an AnalyticDB for PostgreSQL instance.
AnalyticDB for PostgreSQL provides the following types of database accounts:
- Privileged account: an account that has all permissions on all databases. The first account created for an instance in the console is a privileged instance.
- Standard accounts: accounts that have all permissions only on their authorized databases.
Note Permissions include SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, and TRIGGER. For information about how to configure permissions, see Manage users and permissions.
- Before you use databases in an AnalyticDB for PostgreSQL instance , you must create a privileged account.
- Standard accounts cannot be created by using the console. For information about how to create standard accounts, see Execute SQL statements to create accounts.
- After you create a privileged account for an instance, you cannot delete the privileged account.
Create a privileged account
- Log on to the AnalyticDB for PostgreSQL console.
- In the upper-left corner of the console, select the region where the instance resides.
- Find the instance that you want to manage and click its ID.
- In the left-side navigation pane, click Account Management.
- Click Create Account.
- In the Create Account panel, specify the following parameters.
Parameter Description Account The name of the privileged account.
- The name can contain lowercase letters, digits, and underscores (_).
- The name must start with a lowercase letter and end with a lowercase letter or a digit.
- The name cannot start with gp.
- The name must be 2 to 16 characters in length.
New Password The password of the privileged account.
- The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
- The following special characters are supported:
! @ # $ % ^ & * ( ) _ + - =
- The password must be 8 to 32 characters in length.
Confirm Password Enter the password of the account again.
- Click OK.
Execute SQL statements to create accounts
- Create a privileged account.
CREATE ROLE <Account name> WITH LOGIN ENCRYPTED PASSWORD <Password> RDS_SUPERUSER;
CREATE role admin0 WITH LOGIN ENCRYPTED PASSWORD '111111' rds_superuser;
- Create a standard account.
CREATE ROLE <Account name> WITH LOGIN ENCRYPTED PASSWORD <'Password'>;
CREATE role test1 WITH LOGIN ENCRYPTED PASSWORD '111111';
|CreateAccount||Creates a privileged account.|
|DescribeAccounts||Queries the accounts created on an AnalyticDB for PostgreSQL instance.|
|ModifyAccountDescription||Modifies the name of an account for an instance.|
|ResetAccountPassword||Resets the password of an account for an instance.|