This topic describes how to create a database account for an AnalyticDB for PostgreSQL instance.
Background information
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.
Precautions
- 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
Notice After the account is created, you can click Reset Password in the Actions column to modify the account password. To ensure data security, we recommend that
you change your password on a regular basis and do not use passwords that you have
used before.
Execute SQL statements to create accounts
- Create a privileged account.
CREATE ROLE <Account name> WITH LOGIN ENCRYPTED PASSWORD <Password> RDS_SUPERUSER;
Example:
CREATE role admin0 WITH LOGIN ENCRYPTED PASSWORD '111111' rds_superuser;
- Create a standard account.
CREATE ROLE <Account name> WITH LOGIN ENCRYPTED PASSWORD <'Password'>;
Example:
CREATE role test1 WITH LOGIN ENCRYPTED PASSWORD '111111';
Related operations
Operation | Description |
---|---|
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. |