Обсуждение: Unable to drop the user

Поиск
Список
Период
Сортировка

Unable to drop the user

От
M Sarwar
Дата:
Hello,

I am trying to drop a user.

 

drop USER Dev_BaoP ;

 

I am getting the below error message.

 

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

privileges for schema public privileges for schema Bronx

 

I tried my best and it is not going away.

Thanks,

Sarwar

 

Re: Unable to drop the user

От
Erik Wienhold
Дата:
On 17/09/2023 17:26 CEST M Sarwar <sarwarmd02@outlook.com> wrote:

> I am trying to drop a user.
>
> drop USER Dev_BaoP ;
>
> I am getting the below error message.
>
> ERROR: role "dev_baop" cannot be dropped because some objects depend on it
> DETAIL: privileges for schema public
> privileges for schema Bronx

You need to revoke those privileges before dropping the role [1].  Use psql
command \dn+ to show them.  Or just use the combo of REASSIGN OWNED BY and
DROP OWNED BY.

See also this recent thread [2].

[1] https://www.postgresql.org/docs/current/role-removal.html
[2] https://www.postgresql.org/message-id/CAGbX52H6XVMzZ96TcyArjOPw2KCUpQ6EC1Ch%3DyPAyUxsL1Qreg%40mail.gmail.com

--
Erik



Re: Unable to drop the user

От
M Sarwar
Дата:
Erik,
That did work.
Appreciated!

Thank you,
Sarwar


From: Erik Wienhold <ewie@ewie.name>
Sent: Sunday, September 17, 2023 12:21 PM
To: M Sarwar <sarwarmd02@outlook.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Unable to drop the user