Search Postgresql Archives

Re: Drop role cascade ?

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

 



On 11/17/22 15:07, David Gauthier wrote:
psql (11.5, server 11.3) on linux

Someone who had privileges in a lot of tables/schemas/DBs left the company.  I want to drop that role but "rop role xxx" won't let me because...  "xxx cannot be dropped because some objects depend on it".

Is there a way to just get rid of this role without revoking xxx in all the individual DB objects he has privs too?  Something like "drop role xxx cascade" ?

1) You might want to confirm that removing that role is not going to leave you a bind where the objects do not have the necessary privileges to complete their tasks.

2) From here :

https://www.postgresql.org/docs/current/sql-droprole.html

"A role cannot be removed if it is still referenced in any database of the cluster; an error will be raised if so. Before dropping the role, you must drop all the objects it owns (or reassign their ownership) and revoke any privileges the role has been granted on other objects. The REASSIGN OWNED and DROP OWNED commands can be useful for this purpose; see Section 22.4 for more discussion."

So you should take a look at:

https://www.postgresql.org/docs/current/sql-reassign-owned.html



--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx






[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 Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux