I need to remove roles and users from postgres AWS RDS.

Can you please suggest on this issue, please share the queries for this.

  • 3
    Can't use DROP ROLE? – McNets Jun 26 '17 at 9:21

If the account is authorised in postgres its just the same command as it would be in a normal postgres server: dropuser -h your.rds.db -U you SteBov would hit me for example

for full details look here: https://www.postgresql.org/docs/current/static/app-dropuser.html

dropping groups is near enough the same, documentation here: https://www.postgresql.org/docs/current/static/sql-dropgroup.html

| improve this answer | |
  • I want revoke for particular user ,particular role like that am have 100 users and want to revoke some permissions for specified users at once Is there any script for this – Yerva Mahendra Reddy Jun 28 '17 at 6:52
  • Is there a way to identify them within the database? from what you're saying here it sounds like you need a new group to allocate those users to and remove them from the current ones. Personally when I'm doing a large update on that scale I take all the entities to change into excel and then concatenate it with the command, so alter group {group} drop username {user} (with the connection details) then the associated add to the new group – Ste Bov Jun 28 '17 at 7:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.