The superuser permissions are not completely released during the use of RDS, so we recommend that you create a separate account and use the schema to manage your private data space when using the database.
- Create an account with the logon permission.
CREATE USER newuser LOGIN PASSWORD 'password';
- Create a schema for the new account.
CREATE SCHEMA newuser;GRANT newuser to myuser;ALTER SCHEMA myuser OWNER TO newuser;REVOKE newuser FROM myuser;
Note If newuser is not added to the myuser role before execution of
ALTER SCHEMA newuser OWNER TO newuser, the following permission error is displayed:
ERROR: must be member of role "newuser"
- Use newuser to log on to the database.
psql -U newuser -h intranet4example.pg.rds.aliyuncs.com -p 3433 pg001 Password for user newuser: psql.bin (9.4.4, server 9.4.1) Type "help" for help.