pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Wienhold <ewie@ewie.name>
To: M Sarwar <sarwarmd02@outlook.com>
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Unable to drop the user
Date: Sun, 17 Sep 2023 18:21:07 +0200 (CEST)
Message-ID: <438062627.116020.1694967667916@office.mailbox.org> (raw)
In-Reply-To: <DM4PR19MB5978D71AED858D4A8DFDC8C4D3F4A@DM4PR19MB5978.namprd19.prod.outlook.com>
References: <PH2P110MB09229008DCEEC260B532A7D2FFF4A@PH2P110MB0922.NAMP110.PROD.OUTLOOK.COM>
	<DM4PR19MB5978D71AED858D4A8DFDC8C4D3F4A@DM4PR19MB5978.namprd19.prod.outlook.com>

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.g...

--
Erik





view thread (3+ messages)  latest in thread

Message-ID: <438062627.116020.1694967667916@office.mailbox.org>
Permalink:  ../438062627.116020.1694967667916@office.mailbox.org/
Also on:    postgresql.org/message-id/438062627.116020.1694967667916@office.mailbox.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ewie@ewie.name, sarwarmd02@outlook.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Unable to drop the user
  In-Reply-To: <438062627.116020.1694967667916@office.mailbox.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox