Matias
Matias

Reputation: 589

ERROR: role cannot be dropped because some objects depend on it

I'm trying to drop a role but getting this: ERROR: role "xyz" cannot be dropped because some objects depend on it It shows which objects are, they are tables on different schemas on different DBs on the server. Is there an easy way to remove the role without having to revoke privileges one by one on all tables/schemas on all databases?

I don't want to drop owned by as I read somewhere, just drop the role

Thanks!

Upvotes: 0

Views: 3946

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 247235

There is no easy way.

Some commands save you work: REASSIGN OWNED, REVOKE ALL ON ALL ... IN SCHEMA .... But eventually, you will have to remove all these dependencies before you can drop the role.

Don't forget that single a role can own objects / have permissions in many databases.

Upvotes: 3

Related Questions