Обсуждение: Unable to drop the user
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
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
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
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
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://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fdocs%2Fcurrent%2Frole-removal.html&data=05%7C01%7C%7Cd4b39ad1b0d74ff6aee908dbb79a1bfe%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638305644772720116%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=M35Tjx8sd9c2GFxYRuBIVY%2FE6ey2NfYPXxQjYWWkqlw%3D&reserved=0
[2] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fmessage-id%2FCAGbX52H6XVMzZ96TcyArjOPw2KCUpQ6EC1Ch%253DyPAyUxsL1Qreg%2540mail.gmail.com&data=05%7C01%7C%7Cd4b39ad1b0d74ff6aee908dbb79a1bfe%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638305644772720116%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=IDIwKIkMnm%2F1QJ3F7dpaPTZouFHQCwutulhjBnUOVJY%3D&reserved=0
--
Erik
> 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://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fdocs%2Fcurrent%2Frole-removal.html&data=05%7C01%7C%7Cd4b39ad1b0d74ff6aee908dbb79a1bfe%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638305644772720116%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=M35Tjx8sd9c2GFxYRuBIVY%2FE6ey2NfYPXxQjYWWkqlw%3D&reserved=0
[2] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fmessage-id%2FCAGbX52H6XVMzZ96TcyArjOPw2KCUpQ6EC1Ch%253DyPAyUxsL1Qreg%2540mail.gmail.com&data=05%7C01%7C%7Cd4b39ad1b0d74ff6aee908dbb79a1bfe%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638305644772720116%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=IDIwKIkMnm%2F1QJ3F7dpaPTZouFHQCwutulhjBnUOVJY%3D&reserved=0
--
Erik