Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/09/2024 03:49 AM
Hi Team,
As per documentation below permissions are to be granted to Postgres DB account. Pls share steps to grant permissions to postgresql DB. let us consider database name as SavintTestDB and account used in connector in testaccount.
• List all available accounts
• Change password of accounts
• Create account
• Delete account
• Grant permissions to the account
Thanks,
Manju V
05/12/2024 09:06 PM
Certainly! To grant permissions to the Postgres database account `testaccount` for the database `SavintTestDB`, you would typically follow these steps:
1. List all available accounts:
You can list all available accounts by querying the `pg_roles` system catalog table.
SELECT rolname FROM pg_roles;
2. Change password of accounts:
You can change the password of an account using the `ALTER ROLE` command.
ALTER ROLE username WITH PASSWORD 'new_password';
Replace `username` with the actual username and `new_password` with the new password.
3. Create account:
If you need to create a new account, you can use the `CREATE ROLE` command.
CREATE ROLE new_username WITH LOGIN PASSWORD 'password';
Replace `new_username` with the desired username and `password` with the password.
4. Delete account:
To delete an account, you can use the `DROP ROLE` command.
DROP ROLE username;
Replace `username` with the username of the account you want to delete.
5. Grant permissions to the account:
To grant permissions on the `SavintTestDB` database to the `testaccount` user, you would typically use the `GRANT` command.
GRANT permission_type ON DATABASE SavintTestDB TO testaccount;
Replace `permission_type` with the specific permissions you want to grant, such as `SELECT`, `INSERT`, `UPDATE`, `DELETE`, etc. If you want to grant all privileges, you can use `ALL PRIVILEGES`.
For example, to grant all privileges:
GRANT ALL PRIVILEGES ON DATABASE SavintTestDB TO testaccount;