Search Postgresql Archives

Re: Which commands are guaranteed to drop role

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2020-04-12 at 00:25 +0300, Andrus wrote:
> User "currentuser"  tries to delete role "roletodelete" from this database using 
> 
> But got error
> 
> ERROR: role "roletodelete" cannot be dropped because some objects depend on it
> DETAIL: privileges for schema public;
> 
> How to create script which  is guaranteed to delete role ?

You cannot write such a script, but you will have to REVOKE and change ownership
and ALTER DEFAULT PRIVILEGES until no more dependencies on the role exist.

That is why you are well advised not to grant permissions to a role that you
plan to drop.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux